Photo: Taylor Vick on Unsplash
Subnetting cheat sheet: every prefix from /8 to /32 (masks, wildcards and hosts)
One table with every IPv4 prefix from /8 to /32: subnet mask, wildcard mask, total addresses, usable hosts and block size. Plus the private ranges and four shortcuts that make subnetting fast.
Bookmark this page. It puts the numbers you need for subnetting, ACLs and OSPF in one place: every IPv4 prefix from /8 to /32 with its subnet mask, wildcard mask, number of addresses, usable hosts and block size. Below the table are the private address ranges and four shortcuts that make subnetting quick, whether you are studying for the CCNA or configuring a real network.
The full subnetting table
"Block size" is how far apart the subnets are, counted in the octet where the mask changes. For example, /26 subnets start every 64 addresses in the fourth octet: .0, .64, .128 and .192.
| Prefix | Subnet mask | Wildcard mask | Addresses | Usable hosts | Block size |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 1 in octet 1 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 128 in octet 2 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 64 in octet 2 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 32 in octet 2 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 16 in octet 2 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 8 in octet 2 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 4 in octet 2 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 2 in octet 2 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 1 in octet 2 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 in octet 3 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 in octet 3 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 in octet 3 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 in octet 3 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 in octet 3 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 in octet 3 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 in octet 3 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 in octet 3 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 128 in octet 4 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 64 in octet 4 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 32 in octet 4 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 16 in octet 4 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 8 in octet 4 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 4 in octet 4 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (point-to-point link) | 2 in octet 4 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (host route) | 1 in octet 4 |
The most used prefixes
- /24 (255.255.255.0): 254 hosts. The classic office or home LAN.
- /23 (255.255.254.0): 510 hosts. A larger user VLAN.
- /26 to /28: 62, 30 and 14 hosts. Small VLANs for printers, cameras, servers or management.
- /30 (255.255.255.252): 2 hosts. Traditional router-to-router links.
- /31: 2 addresses, both usable, on point-to-point links (RFC 3021). Saves addresses on many links.
- /32: a single address, used for loopbacks and host routes.
Private IPv4 ranges (RFC 1918)
| Range | Prefix | Typical use |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | Large enterprises and cloud networks |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | Medium networks, some cloud and container defaults |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | Home and small office networks |
Also worth knowing: 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (the address a device gives itself when DHCP fails) and 100.64.0.0/10 is shared address space used by internet providers for carrier-grade NAT.
Four shortcuts that make subnetting fast
1. Block size = 256 minus the interesting octet
For 255.255.255.224, the interesting octet is 224, so the block size is 256 − 224 = 32. Subnets start at 0, 32, 64, 96 and so on.
2. Hosts = 2 to the power of host bits, minus 2
A /27 has 5 host bits: 25 = 32 addresses, minus the network and broadcast addresses = 30 usable hosts.
3. Broadcast = next network minus 1
For 192.168.1.70/26, the subnets are .0, .64, .128 and .192. The address sits in .64, the next network is .128, so the broadcast is 192.168.1.127 and usable hosts run from .65 to .126.
4. Wildcard = 255 minus each mask octet
255.255.255.240 becomes 0.0.0.15. Cisco ACLs and OSPF network statements use wildcard masks, so this one comes up constantly.
Practise until it is automatic
Check your answers with the subnet calculator and the wildcard mask calculator, then work through subnetting step by step and the subnetting in your head method. Before the exam, read 7 subnetting mistakes that cost marks in the CCNA.
Written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. Share the link freely; please don't copy the text elsewhere without permission.