IPv4 Subnet Cheatsheet
Complete reference for every IPv4 prefix from /0 to /32. How many IPs in a /24? 256. In a /16? 65,536. How many usable hosts? Subtract 2 for network and broadcast (except /31 and /32 which are special).
Quick Answers
Full Subnet Table — /0 to /32
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Wildcard |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 | 255.255.255.255 |
| /1 | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 | 127.255.255.255 |
| /2 | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 | 63.255.255.255 |
| /3 | 224.0.0.0 | 536,870,912 | 536,870,910 | 31.255.255.255 |
| /4 | 240.0.0.0 | 268,435,456 | 268,435,454 | 15.255.255.255 |
| /5 | 248.0.0.0 | 134,217,728 | 134,217,726 | 7.255.255.255 |
| /6 | 252.0.0.0 | 67,108,864 | 67,108,862 | 3.255.255.255 |
| /7 | 254.0.0.0 | 33,554,432 | 33,554,430 | 1.255.255.255 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 0.255.255.255 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 | 0.127.255.255 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | 0.63.255.255 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 | 0.31.255.255 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 0.15.255.255 |
| /13 | 255.248.0.0 | 524,288 | 524,286 | 0.7.255.255 |
| /14 | 255.252.0.0 | 262,144 | 262,142 | 0.3.255.255 |
| /15 | 255.254.0.0 | 131,072 | 131,070 | 0.1.255.255 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 0.0.255.255 |
| /17 | 255.255.128.0 | 32,768 | 32,766 | 0.0.127.255 |
| /18 | 255.255.192.0 | 16,384 | 16,382 | 0.0.63.255 |
| /19 | 255.255.224.0 | 8,192 | 8,190 | 0.0.31.255 |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 0.0.15.255 |
| /21 | 255.255.248.0 | 2,048 | 2,046 | 0.0.7.255 |
| /22 | 255.255.252.0 | 1,024 | 1,022 | 0.0.3.255 |
| /23 | 255.255.254.0 | 512 | 510 | 0.0.1.255 |
| /24 | 255.255.255.0 | 256 | 254 | 0.0.0.255 |
| /25 | 255.255.255.128 | 128 | 126 | 0.0.0.127 |
| /26 | 255.255.255.192 | 64 | 62 | 0.0.0.63 |
| /27 | 255.255.255.224 | 32 | 30 | 0.0.0.31 |
| /28 | 255.255.255.240 | 16 | 14 | 0.0.0.15 |
| /29 | 255.255.255.248 | 8 | 6 | 0.0.0.7 |
| /30 | 255.255.255.252 | 4 | 2 | 0.0.0.3 |
| /31 | 255.255.255.254 | 2 | 2 | 0.0.0.1 |
| /32 | 255.255.255.255 | 1 | 1 | 0.0.0.0 |
RFC 1918 Private Address Ranges
These ranges are not routable on the public internet. Used for LANs, VPNs, lab networks.
Special-Use IPv4 Blocks
Common Subnet Questions
How many IP addresses in a /24?
A /24 contains 256 IP addresses, of which 254 are usable for hosts. The first address (e.g. 192.168.1.0) is the network address and the last (192.168.1.255) is the broadcast.
How many IP addresses in a /16?
A /16 contains 65,536 IP addresses — that's 256 × 256, or 256 /24 subnets. Usable hosts: 65,534.
How many IPs in a /22?
A /22 contains 1,024 IP addresses — equivalent to four /24 subnets. Usable: 1,022. /22 is the minimum new IPv4 allocation from ARIN and RIPE NCC.
What's the subnet mask for /24?
The /24 subnet mask is 255.255.255.0. Wildcard mask: 0.0.0.255.
What's the subnet mask for /30?
/30 has subnet mask 255.255.255.252. Total: 4 addresses. Usable: 2 (used for router-to-router point-to-point links).
Why subtract 2 from total IPs?
In every IPv4 subnet larger than /31, the first address is reserved as the network address (host bits all 0) and the last as the broadcast address (host bits all 1). Hosts can't use these. /31 is the exception: RFC 3021 allows /31 for point-to-point links with both addresses usable. /32 is a single host.
Class A vs Class B vs Class C — are these still relevant?
The classful system was deprecated in 1993 by CIDR (RFC 1518/1519). The class names persist informally: Class A = /8, Class B = /16, Class C = /24. Modern routing and allocation are entirely classless and use variable-length prefixes.
Need More Detail?
Calculate any specific CIDR block, see its host range, or look up real ownership.