Subnet masks worth memorising
This is the short list every network engineer ends up knowing by heart: the subnet mask, wildcard mask, and usable host count for each common CIDR prefix. The full interactive cheat sheet lives on the CIDR reference page.
| Prefix | Mask | Wildcard | Usable hosts |
|---|---|---|---|
| /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 |
How to use the cheat sheet
Find the prefix you are working with in the left column, then read across for its mask and how many hosts it holds. Working the other way, if you know how many hosts you need, scan the host column for the smallest prefix that fits and use its mask.
The full sortable table, with every prefix from /0 to /32 and a copy button on each row, lives on the CIDR reference page. Each prefix also has its own page with a live calculator.
The numbers worth memorising
A few prefixes come up constantly. A /24 is 255.255.255.0 with 254 hosts, the default LAN. A /30 is 255.255.255.252 with 2 hosts, the classic point-to-point link. A /26 is 255.255.255.192 with 62 hosts, a common small segment. A /16 is 255.255.0.0 with 65,534 hosts, a large site block.
Learn the host counts as powers of two minus two: /24 is 2^8 - 2 = 254, /25 is 2^7 - 2 = 126, /26 is 2^6 - 2 = 62, and so on down. Once that clicks, you rarely need the sheet at all.
Frequently asked questions
What is the mask for a /26?
A /26 has the mask 255.255.255.192, with 64 addresses and 62 usable hosts.
How many hosts are in a /30?
A /30 has 4 addresses and 2 usable hosts, which is why it is used for point-to-point links.
What is the smallest subnet?
A /32 describes a single address (one host route). A /31 has two usable addresses under RFC 3021 and is used for point-to-point links.