Subnet Cheat Sheet: Subnet Mask & CIDR Table
This subnet mask cheat sheet lists every IPv4 prefix from /0 to /32. Each prefix opens in the Subnet calculator. To size several subnets from host counts, use the VLSM calculator, or drill the steps on subnetting practice.
IPv4 prefixes /0 to /32
| Prefix | Subnet mask | Wildcard mask | Total addresses | Usable hosts | /24s |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 | 16,777,216 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | 8,388,608 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | 4,194,304 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | 2,097,152 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | 1,048,576 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | 524,288 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | 262,144 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | 131,072 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 65,536 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 2,048 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 1,024 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 512 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 1/64 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | 1/128 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 1/256 |
Subnetting cheat sheet by octet
For /25 to /30 the mask changes only in the last octet. That value is the magic number's source: subtract it from 256 to get the block size, then the subnet starts are the multiples of the block.
Hosts to prefix
Pick the row whose usable hosts cover what you need. A count that is not listed rounds up to the next row: 50 hosts use the 62-host /26.
A /24 subnet
A /24 is the block most people mean by a subnet on a LAN: 256 addresses, 254 usable hosts, mask 255.255.255.0. The /24s column of the table is 1 for this row, because the block is exactly one /24. 192.168.1.0/24
Subnet mask for /23
A /23 joins two /24s. It has 512 addresses and 510 usable hosts, and the mask is 255.255.254.0. The network address must be even in the third octet: 10.0.0.0/23 runs from 10.0.0.0 through 10.0.1.255. Writing 10.0.1.0/23 names the same block; the network address is still 10.0.0.0.
A /26 subnet
A /26 has 64 addresses and 62 usable hosts. The mask is 255.255.255.192. Four of them fill a /24, starting at .0, .64, .128 and .192. A request for 50 hosts rounds up to this size. 10.0.0.0/26
A /27 subnet
A /27 has 32 addresses and 30 usable hosts. The mask is 255.255.255.224, and eight /27s fit in a /24. It is a common size for a small office or a cloud subnet that needs more than a /28. 10.0.0.0/27
Subnet for /29
A /29 has 8 addresses and 6 usable hosts. The mask is 255.255.255.248. The block starts on a multiple of 8, which is why 192.168.1.8/29 covers .8 through .15. It is a usual size for a small link or a handful of servers.
A /30 subnet
A /30 has 4 addresses and 2 usable hosts. The mask is 255.255.255.252. That is the classic point-to-point size: one address for each end of the link, plus the network and broadcast addresses. 10.0.0.0/30
A /31 subnet
A /31 has 2 addresses and both are usable. The mask is 255.255.255.254. RFC 3021 uses it on a point-to-point link so neither address is spent on a network or broadcast address. 10.0.0.0/31
Splitting a /24
| Prefix | Last mask octet | Subnets in a /24 | Block size | Usable hosts | Networks start at .x |
|---|---|---|---|---|---|
| /24 | 0 | 1 | 256 | 254 | 0 |
| /25 | 128 | 2 | 128 | 126 | 0, 128 |
| /26 | 192 | 4 | 64 | 62 | 0, 64, 128, 192 |
| /27 | 224 | 8 | 32 | 30 | 0, 32, 64, 96, 128, 160, 192, 224 |
| /28 | 240 | 16 | 16 | 14 | 0, 16, 32, 48, … 240 |
| /29 | 248 | 32 | 8 | 6 | 0, 8, 16, 24, … 248 |
| /30 | 252 | 64 | 4 | 2 | 0, 4, 8, 12, … 252 |
| /31 | 254 | 128 | 2 | 2 | 0, 2, 4, 6, … 254 |
| /32 | 255 | 256 | 1 | 1 | 0, 1, 2, 3, … 255 |
Mask octet values
| Ones | Binary | Mask octet | Block size | Wildcard octet |
|---|---|---|---|---|
| 0 | 00000000 | 0 | 256 | 255 |
| 1 | 10000000 | 128 | 128 | 127 |
| 2 | 11000000 | 192 | 64 | 63 |
| 3 | 11100000 | 224 | 32 | 31 |
| 4 | 11110000 | 240 | 16 | 15 |
| 5 | 11111000 | 248 | 8 | 7 |
| 6 | 11111100 | 252 | 4 | 3 |
| 7 | 11111110 | 254 | 2 | 1 |
| 8 | 11111111 | 255 | 1 | 0 |
Private and special IPv4 ranges
| Block | Range | Use | RFC |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | Private | 1918 |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | Private | 1918 |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | Private | 1918 |
| 100.64.0.0/10 | 100.64.0.0 – 100.127.255.255 | Carrier-grade NAT | 6598 |
| 127.0.0.0/8 | 127.0.0.0 – 127.255.255.255 | Loopback | 1122 |
| 169.254.0.0/16 | 169.254.0.0 – 169.254.255.255 | Link-local | 3927 |
| 192.0.2.0/24 | 192.0.2.0 – 192.0.2.255 | Documentation | 5737 |
| 198.51.100.0/24 | 198.51.100.0 – 198.51.100.255 | Documentation | 5737 |
| 203.0.113.0/24 | 203.0.113.0 – 203.0.113.255 | Documentation | 5737 |
| 198.18.0.0/15 | 198.18.0.0 – 198.19.255.255 | Benchmarking | 2544 |
| 224.0.0.0/4 | 224.0.0.0 – 239.255.255.255 | Multicast | 5771 |
| 240.0.0.0/4 | 240.0.0.0 – 255.255.255.254 | Reserved | 1112 |
IPv6 prefix sizes
| Prefix | /64 subnets | Addresses | Common use |
|---|---|---|---|
| /32 | 4,294,967,296 | 296 | Typical RIR allocation to an ISP |
| /40 | 16,777,216 | 288 | Large customer or regional block |
| /44 | 1,048,576 | 284 | Mid-size organisation |
| /48 | 65,536 | 280 | One site (RFC 6177 guidance) |
| /52 | 4,096 | 276 | Building or campus zone |
| /56 | 256 | 272 | Home or small office from an ISP |
| /60 | 16 | 268 | Smallest common delegation to a home |
| /64 | 1 | 264 | One LAN / VLAN (SLAAC needs /64) |
| /112 | — | 65,536 | Sometimes used to save space on infrastructure |
| /126 | — | 4 | Point-to-point (avoid; prefer /127) |
| /127 | — | 2 | Point-to-point link (RFC 6164) |
| /128 | — | 1 | Single address (loopback, anycast) |
Using the tables
Use the main table as a CIDR notation cheat sheet: the prefix is enough to read off the mask, the wildcard and the host count. To size a subnet, find the first row whose usable hosts cover what you need: 50 hosts need a /26 (62 usable). To find the network an address belongs to, take the block size from the mask octet table and round the address down to a multiple of it: 192.168.1.77/27 has block size 32, and 77 rounds down to 64, so the network is 192.168.1.64/27. The subnetting tutorial explains each step, and the VLSM calculator does it for a whole list of subnets. The same prefix table is on the Subnet calculator when you type an address.