CIDR Calculator
192.168.1.10/24 breaks down to network 192.168.1.0, broadcast 192.168.1.255, and 254 usable hosts. A CIDR calculator takes an IPv4 address written in CIDR notation, meaning an address and a prefix length such as /24, and works out everything that notation implies: the subnet mask, the network address, the broadcast address, the first and last usable host, and the total number of addresses in that block. Enter an address and prefix like 10.0.0.5/16 or 172.16.5.200/20, and the tool applies standard IPv4 bitwise subnetting rules to return every value at once. It is built for network engineers, sysadmins, students studying for certification exams, and anyone who needs to read a CIDR block without working through binary math by hand.
Quick answer
CIDR notation combines an IPv4 address with a prefix length, written as address/prefix, such as 192.168.1.10/24.
What this tells you
- •CIDR notation combines an IPv4 address with a prefix length, written as address/prefix, such as 192.168.1.10/24.
- •The prefix length tells the tool how many leading bits of the address are the network portion, with the remaining bits available for host addresses.
- •Results include the subnet mask, network address, broadcast address, and the usable host range for that block.
- •Usable host counts follow standard IPv4 convention: the network address and broadcast address are excluded from the usable range for prefixes /0 through /30.
- •Prefixes /31 and /32 are special cases. A /31 has no separate network or broadcast address under the usual rule, and a /32 identifies a single host.
- •This calculator handles IPv4 CIDR only. It does not parse or validate IPv6 prefixes.
How to Use
- 1Enter a CIDR string in the single input field, combining an IPv4 address and a prefix length separated by a slash, such as 10.0.0.5/16.
- 2Make sure the address has four octets between 0 and 255 and the prefix is a whole number between 0 and 32. Anything outside those ranges will not calculate.
- 3Click calculate to generate the subnet mask, network address, broadcast address, first usable host, last usable host, and total usable host count.
- 4Compare the network address against the address you entered. If they differ, your input address sits somewhere inside the block rather than exactly on the network boundary, which is normal and expected.
- 5Review the usable host range and the /31 or /32 special-case behavior before applying the result to a real routing table, firewall rule, or subnet plan.
How It Works
Formula
Mask = prefix bits set to 1, remaining bits set to 0
Network address = IP address AND mask
Broadcast address = Network address OR (NOT mask)
Total addresses = 2^(32 - prefix)
Usable hosts = 2^(32 - prefix) - 2, except /31 and /32 where usable hosts = 0A 32-bit IPv4 address is treated as a string of 32 binary digits. The prefix length, the number after the slash, says how many of those leading bits belong to the network. The tool builds a subnet mask by setting that many leading bits to 1 and the rest to 0, so a /24 mask is 24 ones followed by 8 zeros, which is 255.255.255.0. It finds the network address by running a bitwise AND between your IP address and the mask, which clears every host bit to 0. It finds the broadcast address by taking the mask, flipping every bit with a bitwise NOT, and OR-ing that against the network address, which sets every host bit to 1. Total addresses in the block is 2 raised to the power of the remaining host bits, or 2^(32-prefix). Usable hosts is normally that total minus 2, because the lowest address in the block is reserved as the network address and the highest is reserved as the broadcast address. The two exceptions are /31, defined by RFC 3021 for point-to-point links where both addresses in the pair are usable endpoints, and /32, which represents exactly one host address with no network or broadcast concept at all. This calculator reports usable hosts as 0 for both /31 and /32 to reflect that the standard network/broadcast/usable-range model does not apply there, even though a /31 link genuinely uses both of its two addresses.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Standard /24 home or office network
A /24 prefix sets a mask of 255.255.255.0, leaving 8 host bits and 256 total addresses. The network address zeroes out those 8 bits to get 192.168.1.0, and the broadcast address sets them all to 1 to get 192.168.1.255. That leaves 254 usable addresses, which is the most common block size for home routers and small office LANs.
Larger /16 block for a campus or site network
A /16 prefix leaves 16 host bits, so the block spans 65,536 total addresses across the third and fourth octets. The mask 255.255.0.0 zeroes out both of those octets for the network address and sets them both to 255 for the broadcast address. Private /16 blocks like this one are common for larger internal networks that get split into smaller subnets later.
Mid-size /20 subnet
A /20 prefix leaves 12 host bits, for 4,096 total addresses and 4,094 usable ones. The mask is 255.255.240.0, so only the last 4 bits of the third octet plus the whole fourth octet vary within the block. Notice the input address 172.16.5.200 is not the network address itself, it just falls inside the 172.16.0.0 to 172.16.15.255 range.
Small /27 subnet carved from a larger block
A /27 prefix leaves only 5 host bits, giving 32 total addresses per block in steps of 32, so this block runs from .128 through .159. The mask 255.255.255.224 clears the low 5 bits for the network address and sets them for the broadcast address. Blocks this size are typical when a /24 gets split into multiple smaller subnets for different departments or VLANs.
Point-to-point /30 link between two routers
A /30 prefix leaves 2 host bits, for exactly 4 total addresses: one network address, one broadcast address, and 2 usable addresses. This is the classic block size for a serial or WAN link connecting exactly two routers, since it wastes only 2 addresses instead of the 252 a /24 would waste on the same link. The input address 10.10.10.10 turns out to be the last usable host in its block, not the network address.
Edge case: /31 point-to-point link
A /31 prefix leaves only 1 host bit, so the block has just 2 total addresses. Under the classic network/broadcast model neither address is usable, which is why this tool reports 0 usable hosts here, but RFC 3021 defines /31 specifically for point-to-point links where both addresses act as real host endpoints. Router and firewall configuration guides often call this out explicitly, since it is one of the few places the 'usable hosts equals total minus 2' rule breaks down.
Common IPv4 Prefix Reference
Subnet mask, total addresses, and usable hosts for the prefix lengths seen most often in practice.
| Prefix | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 0 (point-to-point exception) |
| /32 | 255.255.255.255 | 1 | 0 (single host) |
Every step down by 1 in prefix length doubles the block size. Going from /24 to /23 doubles a 256-address block into a 512-address block.
Reading CIDR notation correctly
CIDR stands for Classless Inter-Domain Routing, and it replaced the older class A, B, and C address system in the 1990s so network sizes could be defined by any prefix length instead of only a few fixed sizes. The prefix number after the slash is what makes a block classless. A /24 does not have to align with a traditional class C boundary, it just means the first 24 bits are fixed as the network portion, wherever that boundary happens to fall.
A smaller prefix number means a bigger block. This trips up a lot of people learning subnetting for the first time, because it feels backward. A /8 covers over 16 million addresses while a /30 covers only 4, so as the prefix number goes up, the network portion of the address grows and the space left for hosts shrinks.
The network address and broadcast address are not addresses you assign to a device. The network address, the lowest address in the block, identifies the subnet itself for routing purposes. The broadcast address, the highest address in the block, is used to send a packet to every host on that subnet at once. Assigning either one to a workstation or server is a common misconfiguration that causes connectivity problems.
VLSM, or variable length subnet masking, is the practice of splitting one larger CIDR block into several smaller ones with different prefix lengths to match the actual number of hosts on each segment. A /24 assigned to a point-to-point router link wastes 252 addresses, while a /30 fits that link with only 2 wasted. This calculator checks one block at a time rather than planning a full VLSM layout, but understanding a single block's network, broadcast, and usable range is the starting point for that kind of design work.
Common mistakes
- Entering a prefix length outside the 0-32 range, or a non-numeric value after the slash, both of which the tool rejects as invalid CIDR notation.
- Assuming /31 and /32 follow the standard 'total minus 2' usable-host rule. A /31 is a documented point-to-point exception and a /32 is a single host with no network or broadcast concept.
- Confusing the network address with the first usable host. The network address, such as 192.168.1.0 in a /24, cannot be assigned to a device, the first usable host starts one address later.
- Typing an address that already has a broadcast or network-style value in it and assuming that address is what the calculator will show back. The tool always derives the block's actual network and broadcast addresses from the mask, which may differ from the address you typed if it was not exactly on a boundary.
- Mixing up the direction of the prefix. A smaller number like /8 means a larger block with more hosts, while a larger number like /30 means a smaller block. It is easy to read this backward when first learning subnetting.
- Treating this IPv4-only tool as if it handles IPv6 prefixes. IPv6 CIDR notation uses the same slash format but a completely different address length and subnetting convention, and this calculator does not parse it.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="cidr-calculator" async></script>Preview the embed at /embed/cidr-calculator/.