Reference January 2025 · 8 min read
Complete IPv4 Subnetting Reference Guide
Everything you need to know about IPv4 subnets in one place.
This is a comprehensive reference for IPv4 subnetting. Bookmark it, print it, keep it handy. Everything you need is on this page.
Subnet Calculator Calculate subnets, masks, and host ranges instantlyCIDR to Subnet Mask Conversion
| CIDR | Subnet Mask | Addresses | Usable Hosts |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 |
| /31 | 255.255.255.254 | 2 | 2 |
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /27 | 255.255.255.224 | 32 | 30 |
| /26 | 255.255.255.192 | 64 | 62 |
| /25 | 255.255.255.128 | 128 | 126 |
| /24 | 255.255.255.0 | 256 | 254 |
| /23 | 255.255.254.0 | 512 | 510 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
Private Address Ranges (RFC 1918)
| Range | CIDR | Total Addresses |
|---|---|---|
| 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Special Address Ranges
| Range | Purpose |
|---|---|
| 127.0.0.0/8 | Loopback |
| 169.254.0.0/16 | Link-local (APIPA) |
| 224.0.0.0/4 | Multicast |
| 240.0.0.0/4 | Reserved |
| 255.255.255.255/32 | Broadcast |
Quick Formulas
- Total addresses: 2^(32 - CIDR)
- Usable hosts: 2^(32 - CIDR) - 2
- Number of subnets: 2^(new bits borrowed)
- Network address: First address in range
- Broadcast address: Last address in range
Subnet Boundaries by CIDR
Networks of a given CIDR size start at multiples of their size:
- /24: .0 (every 256 addresses)
- /25: .0, .128 (every 128)
- /26: .0, .64, .128, .192 (every 64)
- /27: .0, .32, .64, .96, .128, .160, .192, .224 (every 32)
- /28: every 16 addresses
- /29: every 8 addresses
- /30: every 4 addresses
Wildcard Masks
Used in access lists, a wildcard mask is the inverse of the subnet mask:
| Subnet Mask | Wildcard Mask |
|---|---|
| 255.255.255.252 (/30) | 0.0.0.3 |
| 255.255.255.0 (/24) | 0.0.0.255 |
| 255.255.0.0 (/16) | 0.0.255.255 |
| 255.0.0.0 (/8) | 0.255.255.255 |
Formula: 255.255.255.255 minus subnet mask = wildcard mask
Binary Reference
Useful values for subnet calculations:
| Decimal | Binary | Use |
|---|---|---|
| 128 | 10000000 | /25 boundary |
| 192 | 11000000 | /26 boundary |
| 224 | 11100000 | /27 boundary |
| 240 | 11110000 | /28 boundary |
| 248 | 11111000 | /29 boundary |
| 252 | 11111100 | /30 boundary |
| 254 | 11111110 | /31 boundary |
| 255 | 11111111 | All bits set |