Subnet Cheat Sheet: CIDR, Mask, Hosts at a Glance
This subnet cheat sheet gives you everything you need for IPv4 subnetting at a glance. Keep it bookmarked. You’ll come back to it more often than you think. The table below shows every CIDR prefix length from /0 to /32 with the corresponding subnet mask, total addresses, usable hosts, and wildcard mask.
The Complete IPv4 Subnet Table
| CIDR | Subnet Mask | Total Addresses | Usable Hosts | Wildcard Mask | Class |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 | 255.255.255.255 | Entire Internet |
| /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 | Class A |
| /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 | Class B |
| /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 | Class C |
| /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 | Point-to-point |
| /31 | 255.255.255.254 | 2 | 2 | 0.0.0.1 | Point-to-point (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 | 0.0.0.0 | Single host |
Quick Calculation Method
To calculate usable hosts for any prefix:
- Host bits = 32 minus prefix length
- Total addresses = 2^(host bits)
- Usable hosts = total addresses minus 2 (network + broadcast)
For /26: 32 minus 26 = 6 host bits → 2^6 = 64 total → 62 usable hosts.
Common Scenarios
| Need | Use | Why |
|---|---|---|
| Home network | /24 | 254 hosts, simple |
| Small office (50 people) | /26 | 62 hosts, conserves space |
| Server subnet | /27 or /28 | 30 or 14 hosts |
| Point-to-point link | /30 or /31 | 2 hosts (just the two routers) |
| Single host route | /32 | Exactly 1 address |
| Cloud VPC | /16 | 65,534 hosts, room to subnet further |
Private Address Space Summary
| Range | CIDR | Use |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | Large organizations |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | Medium organizations |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | Home/small office |
Test It Yourself
Check Your Network
Look up your IP address and see which subnet and network block you're part of.
Frequently Asked Questions
A /24 (255.255.255.0) is by far the most common. It provides 254 usable host addresses, which is plenty for most small to medium networks. It's the default allocation for home networks and small offices.
Take 2 to the power of (32 minus prefix length), then subtract 2. The subtracted 2 are the network address (first) and broadcast address (last). So /24 = 2^8 - 2 = 254 usable hosts.
On this page