This is the reference table you reach for when you need to remember whether a /22 is 1,022 or 1,024 hosts, or what dotted-decimal mask matches /27. Bookmark this page, or download the printable cheat sheet from our home page.
The table covers all 33 prefix lengths (/0 to /32) with the standard fields: dotted-decimal mask, hex, total addresses, usable hosts (RFC 1812), AWS-usable count (after AWS's 5-IP reservation), and typical use cases.
Full table: /0 to /32
| Prefix | Mask | Total | Usable | AWS Usable | Typical use |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 4.29B | — | — | Default route |
| /8 | 255.0.0.0 | 16.7M | 16.7M | — | Class A, full RFC1918 (10/8) |
| /12 | 255.240.0.0 | 1.05M | 1.05M | — | RFC1918 (172.16/12), cloud allocation |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 65,531 | Class B, AWS max VPC |
| /17 | 255.255.128.0 | 32,768 | 32,766 | 32,763 | Large VPC tier |
| /18 | 255.255.192.0 | 16,384 | 16,382 | 16,379 | EKS cluster pod CIDR |
| /19 | 255.255.224.0 | 8,192 | 8,190 | 8,187 | Large workload subnet |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 4,091 | Standard AWS app tier per AZ |
| /21 | 255.255.248.0 | 2,048 | 2,046 | 2,043 | Medium subnet |
| /22 | 255.255.252.0 | 1,024 | 1,022 | 1,019 | EKS node group subnet |
| /23 | 255.255.254.0 | 512 | 510 | 507 | Medium workload subnet |
| /24 | 255.255.255.0 | 256 | 254 | 251 | Class C, standard subnet, DB tier |
| /25 | 255.255.255.128 | 128 | 126 | 123 | Small DB tier |
| /26 | 255.255.255.192 | 64 | 62 | 59 | Specialized service subnet |
| /27 | 255.255.255.224 | 32 | 30 | 27 | VPC endpoint subnet |
| /28 | 255.255.255.240 | 16 | 14 | 11 | AWS minimum subnet, TGW attach |
| /29 | 255.255.255.248 | 8 | 6 | — | Azure minimum, small P2P range |
| /30 | 255.255.255.252 | 4 | 2 | — | Standard P2P link |
| /31 | 255.255.255.254 | 2 | 2 | — | RFC 3021 P2P (no network/broadcast) |
| /32 | 255.255.255.255 | 1 | 1 | — | Single host route, loopback |
Prefixes between /8 and /16 not shown above follow the same pattern. The total address count for any /N is exactly 2^(32-N). Usable (RFC 1812) is total minus 2 for the network and broadcast addresses, except /31 (2 usable per RFC 3021) and /32 (1 usable).
Conversion tricks
Prefix to dotted-decimal mask
The mask has N consecutive 1 bits followed by (32-N) 0 bits. To convert mentally:
- Divide the prefix by 8 to find the number of complete
255octets. - The remainder is the number of leading 1 bits in the next octet.
- Map the remainder using the octet table (below).
| Leading 1s | Octet value | Magic number (256 − value) |
|---|---|---|
| 0 | 0 | 256 |
| 1 | 128 | 128 |
| 2 | 192 | 64 |
| 3 | 224 | 32 |
| 4 | 240 | 16 |
| 5 | 248 | 8 |
| 6 | 252 | 4 |
| 7 | 254 | 2 |
| 8 | 255 | 1 |
Example: /22 → 22 ÷ 8 = 2 remainder 6. Two complete 255 octets, then 252 (6 leading 1s), then zeros. Mask = 255.255.252.0. Magic number for /22 in the third octet = 4.
Mask to wildcard mask
Wildcard = inverse of subnet mask. For each octet: wildcard = 255 - mask.
| Prefix | Subnet mask | Wildcard mask |
|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 |
| /22 | 255.255.252.0 | 0.0.3.255 |
| /16 | 255.255.0.0 | 0.0.255.255 |
Used in Cisco ACLs and OSPF area declarations. See our wildcard mask article for details.
Cloud-specific reserved IP counts
The "AWS Usable" column above subtracts 5 from the standard usable count. For other clouds:
| Provider | Reserved per subnet | Minimum subnet |
|---|---|---|
| AWS VPC | 5 | /28 |
| Azure VNet | 5 | /29 |
| Google Cloud VPC | 4 | /29 |
| Oracle Cloud | 3 | /30 |
For full AWS specifics see our AWS reserved IPs deep dive.
Calculator and quick reference
For one-off lookups, paste any CIDR into our CIDR calculator and get the network address, broadcast, usable range, and cloud-mode numbers instantly. For interactive visualization of how a /24 splits into /26s splits into /28s, use our subnet visualizer.
Key takeaways
- Total addresses in /N =
2^(32-N). Usable hosts = total − 2 (except /31 and /32). - Subtract 5 from usable for AWS subnets, 5 for Azure, 4 for GCP, 3 for OCI.
- Minimum cloud subnets: AWS /28, Azure /29, GCP /29, OCI /30.
- Magic number for any prefix = 256 − (octet value at the prefix boundary). Use it for fast mental subnet math.