Tools Guides
developer Free No signup

IP / CIDR Network Calculator

Enter an IPv4 address with a CIDR prefix or subnet mask to calculate network address, broadcast, host range, wildcard, and binary breakdown.

Loading tool…

About this tool

Input an IPv4 address and either a CIDR prefix length (e.g. /24) or a dotted-decimal subnet mask (e.g. 255.255.255.0). The tool instantly calculates the network address, broadcast address, first and last usable host, total host count, usable host count, subnet mask, wildcard mask, and IP class (A through E). A binary table shows all four octets of the IP, network address, subnet mask, and broadcast address aligned in 8-bit groups so you can see exactly which bits define the network and host portions.

How to use

  1. 1 Enter an IPv4 address in the first field (e.g. 192.168.1.0).
  2. 2 Enter the CIDR prefix length (e.g. 24) or a dotted-decimal subnet mask (e.g. 255.255.255.0).
  3. 3 Click Calculate (or press Enter) to see the full network breakdown.
  4. 4 Review the binary table at the bottom to visualize the network and host bit boundaries.

What a subnet calculation answers

An IPv4 address like 192.168.1.0 is only half the picture. The other half is the prefix (written as /24) or its equivalent subnet mask (255.255.255.0), which decides how many of the 32 bits identify the network and how many identify individual hosts on it. From those two inputs this tool derives everything you need to plan or troubleshoot a network: the network address, the broadcast address, the usable host range, the total and usable host counts, the wildcard mask, the address class, and a binary breakdown.

The bit math behind every result

An IPv4 address is really a single 32-bit number; 192.168.1.0 is just a readable way to write four 8-bit octets. The prefix /24 means the first 24 bits are the network portion. Internally the tool:

  • Builds the subnet mask by setting the top 24 bits to 1 and the rest to 0, giving 255.255.255.0.
  • Computes the network address with a bitwise AND of the IP and the mask — this zeroes out the host bits.
  • Computes the broadcast address by setting all host bits to 1 (an OR with the inverted mask, called the wildcard mask).
  • Derives the host range as everything between network + 1 and broadcast − 1.

A worked example: 192.168.1.0/24

PropertyValue
Network address192.168.1.0
Broadcast address192.168.1.255
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254

The host count comes from the formula 2^(32 − prefix). For a /24 that is 2^8 = 256 total addresses. Two are reserved — the network address itself and the broadcast address — leaving 254 usable for actual devices. That "minus two" rule is the single most important thing to remember when sizing a subnet.

The /31 and /32 edge cases

The minus-two rule breaks down at the extremes, and the tool handles this correctly. A /31 has only two addresses; reserving both would leave zero usable hosts, so by convention (RFC 3021) both are usable for point-to-point links between two routers. A /32 is a single address — one exact host, used for loopbacks and routing entries — so the tool reports no usable range rather than a negative number.

Why the binary view matters

The binary table colors the network bits one way and the host bits another, lined up across all four octets. This makes the boundary between network and host visible, which is the concept people most often get wrong with non-byte-aligned prefixes like /26. A /26 mask is 255.255.255.192 — the boundary falls inside the last octet, splitting it into a 2-bit network part and a 6-bit host part, yielding four subnets of 64 addresses (62 usable) each. Seeing the bits makes that far clearer than the dotted-decimal mask alone.

Use cases

  • Planning a network. Decide how to carve a block into subnets that each hold enough hosts, without wasting addresses.
  • Writing firewall and ACL rules. Many systems express ranges in CIDR (10.0.0.0/8) or wildcard form (Cisco ACLs); the tool gives you both.
  • Troubleshooting connectivity. If two devices can't talk, confirming they share the same network and broadcast address often reveals a mismatched mask.
  • Studying for certifications. CCNA and similar exams lean heavily on fast subnetting; the step-by-step values and binary view reinforce the method.

Tips and common mistakes

  • The mask must be contiguous. Valid masks are an unbroken run of 1s followed by 0s. Something like 255.255.0.255 is invalid, and the tool rejects it rather than producing a nonsense result.
  • Enter the network address, or any host in it. You can type any address in the range — the tool ANDs it with the mask to find the true network address, so 192.168.1.37/24 still resolves to the 192.168.1.0 network.
  • Class is informational only. The old A/B/C classes were replaced by CIDR decades ago; the tool reports the class for reference, but the prefix you supply, not the class, governs the actual subnet.
  • Don't forget the reserved addresses when counting capacity. A /24 holds 254 devices, not 256 — plan for the two-address overhead on every standard subnet.

Privacy

Every calculation is plain integer bit-math done in your browser. The addresses you enter are never transmitted or logged, and the tool runs entirely offline once the page has loaded.

Frequently Asked Questions

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}