Subnet Cheat Sheet
The /0–/32 reference: mask, wildcard, hosts and block size.
| CIDR | Subnet mask | Wildcard | Usable hosts | Total |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,294 | 4,294,967,296 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,646 | 2,147,483,648 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,822 | 1,073,741,824 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,910 | 536,870,912 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,454 | 268,435,456 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,726 | 134,217,728 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,862 | 67,108,864 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,430 | 33,554,432 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 | 16,777,216 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,606 | 8,388,608 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,302 | 4,194,304 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,150 | 2,097,152 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,574 | 1,048,576 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,286 | 524,288 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,142 | 262,144 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,070 | 131,072 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 | 65,536 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,766 | 32,768 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,382 | 16,384 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,190 | 8,192 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 | 4,096 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,046 | 2,048 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 | 1,024 |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 | 512 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 | 256 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 | 128 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 | 64 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 | 32 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 | 16 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 | 8 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 | 4 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
About this tool
Free IPv4 subnet cheat sheet. A complete /0 to /32 reference table of CIDR prefix, subnet mask, wildcard mask, usable hosts, total addresses and block size — printable and searchable. Everything runs entirely in your browser — nothing you type is sent to a server.
Every prefix length from /0 to /32 maps to one subnet mask, one wildcard mask and a fixed number of addresses. Engineers who subnet quickly have the last octet memorised; everyone else keeps a table like this one nearby. Use the search to jump to a prefix, or print the page.
How to use the Subnet Cheat Sheet
- Search for a prefix (
/27), a mask (255.255.255.224) or a host count. - Read across the row: mask, wildcard, total addresses, usable hosts and block size.
- Use the block size to find valid network addresses: they are multiples of it in the relevant octet.
The rows you will use most
/24 255.255.255.0 0.0.0.255 256 addresses 254 hosts /25 255.255.255.128 0.0.0.127 128 126 /26 255.255.255.192 0.0.0.63 64 62 /27 255.255.255.224 0.0.0.31 32 30 /28 255.255.255.240 0.0.0.15 16 14 /29 255.255.255.248 0.0.0.7 8 6 /30 255.255.255.252 0.0.0.3 4 2 /31 255.255.255.254 0.0.0.1 2 2 (point-to-point, RFC 3021) /32 255.255.255.255 0.0.0.0 1 1 (host route)
The pattern repeats in each octet: /16 to /23 follow the same masks in the third octet, and /8 to /15 in the second.
How the table is built
Each row follows from one number, the prefix length n. The mask has n ones followed by 32 - n zeros. The total number of addresses is 2^(32 - n). The wildcard mask is the mask's bits inverted.
Because masks fill bits from the left, the only values that ever appear in a mask octet are 0, 128, 192, 224, 240, 248, 252, 254 and 255. Learning those nine values, and that each one halves the block size of the one before, is most of what you need to subnet in your head.
Reading the results
- Block size
- 256 minus the interesting octet of the mask. Networks start at multiples of it.
- Usable hosts
- 2^(32 - prefix) minus 2, except /31 and /32.
- Wildcard
- 255 minus each mask octet.
Common mistakes
- Forgetting to subtract the network and broadcast addresses.
- Assuming a /23 spans x.x.1.0 to x.x.2.255. A /23 must start on an even third octet, for example x.x.2.0 to x.x.3.255.
Frequently asked questions
How many hosts are in a /28?
14 usable out of 16 addresses.
What is the mask for /22?
255.255.252.0, covering four /24s.
How do I memorise the masks?
Learn the bit values 128, 64, 32, 16, 8, 4, 2, 1 and add them up: 128+64+32 = 224 for three bits, which is /27 in the last octet.