Reference
Subnet mask cheat sheet.
Mask, wildcard, block size and host count for every prefix from /8 to /32. Then practise it in the free drill.
Every prefix, /8 to /32
The shaded rows, /24 to /30, cover almost every exam question.
| Prefix | Subnet mask | Wildcard | Block size | Addresses | Usable hosts |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 256 2nd octet | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 128 2nd octet | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 64 2nd octet | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 32 2nd octet | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 16 2nd octet | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 8 2nd octet | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 4 2nd octet | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 2 2nd octet | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 256 3rd octet | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 128 3rd octet | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 64 3rd octet | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 32 3rd octet | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 16 3rd octet | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 8 3rd octet | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 4 3rd octet | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 2 3rd octet | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 4th octet | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 4th octet | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 4th octet | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 4th octet | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 4th octet | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 4th octet | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 4th octet | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 4th octet | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 4th octet | 1 | 1 |
Where the columns come from
Three rules produce the whole table
- 01
Block size
256 minus the mask in the first octet that is not 255. A /26 mask ends in 192, so the block size is 64.
- 02
Wildcard mask
255 minus each octet of the mask. It is the mask turned inside out, which is how ACLs and OSPF network statements write it.
- 03
Usable hosts
2 to the power of the host bits, minus 2 for the network and broadcast addresses. A /26 has 6 host bits: 64 − 2 = 62.
Questions about the table
How to read it and why the numbers are what they are.
It is the step between one subnet and the next in the octet it names. A /26 has a block size of 64 in the fourth octet, so the subnets start at .0, .64, .128 and .192. A block of 256 means the whole octet: the next network starts one octet earlier.
The first address of a subnet is its network address and the last is its broadcast address, so neither can be given to a host. Two exceptions: a /31 has two usable addresses because it is used on point-to-point links (RFC 3021), and a /32 is a single host address.
The rows from /24 to /30 are highlighted in the table. They cover almost every subnetting question, because the hard part is the interesting octet, and from /24 to /30 that is always the fourth.
Every figure is computed from the prefix when the page is built, not typed in, so a typo cannot get into a row. Practise with it in the free drill, which grades the answer you work out.
Ready to see it work? Try a drill
Ready to pass the exam?Start drilling today
Practice that grades itself, so you always know why.
Try the first drill now. No sign-up needed.