JSON Formatter
Pretty-print, validate and minify JSON with precise error positions.
Developer & Security
CIDR to mask, host range, broadcast and usable count.
| CIDR | Netmask | Addresses | Usable |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /24 | 255.255.255.0 | 256 | 254 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
Usable is always two fewer than the total on IPv4: the all-zeros host is the network address and the all-ones host is the broadcast. The exception is /31, which RFC 3021 defines as a two-address point-to-point link with no broadcast, and /32, a single host.
The prefix counts network bits, so a smaller prefix leaves more bits for hosts. A /16 is 256 times larger than a /24, which reads backwards until you think in bits.
Each step down doubles the size: /25 is 128 addresses, /24 is 256, /23 is 512.
A practical consequence is that networks must align to their own size. A /24 can start at .0 or 10.0.1.0 but not at 10.0.0.128 — the network address must have zeros in all host bits, so blocks sit on boundaries that are multiples of their size.
Three IPv4 ranges are reserved for private use and are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
The 172.16 range is the one people get wrong. It is a /12, so it spans 172.16.0.0 to 172.31.255.255 — not 172.16 to 172.16.255.255, and not all of 172.
Also worth knowing: 169.254.0.0/16 is link-local, which is what a machine assigns itself when DHCP fails. An address in that range is a symptom, not a configuration.
254. A /24 contains 256 addresses; the first is the network address and the last is the broadcast, so neither can be assigned to a host.
The prefix counts network bits, so a smaller prefix leaves more bits for hosts. A /16 leaves 16 host bits — 65,536 addresses — against a /24’s 8 bits and 256.
Point-to-point links. RFC 3021 allows both addresses in a /31 to be used, because a two-endpoint link has no need for a broadcast address. It saves two addresses per link across a large network.
172.16.0.0/12, which spans 172.16.0.0 to 172.31.255.255. It is not all of 172, and not only 172.16 — this is the most commonly misremembered of the three private ranges.
That is link-local, self-assigned when DHCP fails to answer. It indicates the device could not reach a DHCP server, so the fix is on the network rather than the device.