// subnet
IPv4 Subnet / CIDR Cheatsheet
Every IPv4 prefix from /0 to /32 with its dotted-decimal mask, wildcard, and host count. Bookmark this — it answers 90% of subnet questions in one glance.
Updated
Full CIDR table
Hosts column shows usable hosts (total − network − broadcast), except /31 and /32 which are listed as total addresses per RFC 3021.
| CIDR | Subnet mask | Wildcard | Usable hosts |
|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 |
Quick formulas
total addresses = 2^(32 − prefix)usable hosts = total − 2(for prefixes ≤ /30)wildcard = 255.255.255.255 − maskbroadcast = network OR wildcard
FAQ
- What does the CIDR /24 mean?
- /24 means the first 24 bits are the network and the last 8 are host bits. The mask is 255.255.255.0, giving 256 total addresses and 254 usable hosts (network + broadcast reserved).
- Why does /31 only have 2 addresses?
- RFC 3021 allows /31 on point-to-point links. Both addresses are usable as endpoints — there's no broadcast or network address.
- How do I calculate the broadcast address?
- Broadcast = network OR wildcard. For 10.0.0.0/24: network 10.0.0.0, wildcard 0.0.0.255, broadcast 10.0.0.255.
- Is /32 a single host?
- Yes. /32 represents a single IPv4 address — common for loopback interfaces, container IPs and host routes.