Networking
Subnet Mask Cheat Sheet: /24, /26, /28, /30 and Host Counts
Use a practical IPv4 subnet mask cheat sheet to understand common CIDR prefixes, address counts, conventional host capacity, block sizes, and network boundaries.
In this article
Subnet Mask Cheat Sheet: /24, /26, /28, /30 and Host Counts
Duck Cloud's Subnet Calculator and CIDR Calculator calculate IPv4 ranges and host capacity.
Common sizes
| CIDR | Subnet mask | Total addresses | Conventional usable hosts* |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
*Traditional host counts subtract network and broadcast addresses. Cloud reservations and modern special cases can change practical capacity.
/24
A /24 leaves 8 host bits:
2^8 = 256/26
A /26 leaves 6 host bits and has blocks of 64 in the final octet:
0, 64, 128, 192So 192.0.2.70/26 belongs to 192.0.2.64/26.
/28
A /28 has 16 total addresses. Final-octet boundaries advance in blocks of 16.
/30
A traditional /30 has 4 total addresses and 2 conventional usable host addresses.
Modern point-to-point networks may use /31 where supported, so do not apply the simple “subtract two” rule blindly to every prefix.
Formula
IPv4 total addresses:
2^(32 - prefix)Cloud reservations
Cloud providers may reserve addresses inside subnets. Always size according to the provider's documented behavior.
Overlap
Before allocating a new network, compare against VPCs, VPNs, office networks, partner ranges, and future environments.
A cheat sheet improves speed, but understanding boundaries is what prevents real routing mistakes.