CIDR Calculator
Format: address/prefix. Prefix 0-32. Examples: 10.0.0.0/8, 172.16.0.0/12, 192.168.1.0/24, 10.0.0.0/31.
How CIDR math works
CIDR (Classless Inter-Domain Routing) replaces the old A/B/C class system with a prefix length — the number of leading 1-bits in the subnet mask. A /24 means the top 24 bits identify the network and the bottom 8 bits identify the host, giving 28 = 256 addresses per block. Two of those (network and broadcast) aren't usable for hosts, so a /24 fits 254 hosts. A /16 fits 65,534. A /30 fits 2.
The two edge cases worth knowing: /31 blocks (RFC 3021) are used for point-to-point links and have no network or broadcast address — both addresses are usable, total = usable = 2. A /32 represents a single host; total = usable = 1. The calculator handles both.
| Prefix | Subnet mask | Total IPs | Usable |
|---|---|---|---|
| /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 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |