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

PrefixMaskTotalUsableAWS UsableTypical use
/00.0.0.04.29BDefault route
/8255.0.0.016.7M16.7MClass A, full RFC1918 (10/8)
/12255.240.0.01.05M1.05MRFC1918 (172.16/12), cloud allocation
/16255.255.0.065,53665,53465,531Class B, AWS max VPC
/17255.255.128.032,76832,76632,763Large VPC tier
/18255.255.192.016,38416,38216,379EKS cluster pod CIDR
/19255.255.224.08,1928,1908,187Large workload subnet
/20255.255.240.04,0964,0944,091Standard AWS app tier per AZ
/21255.255.248.02,0482,0462,043Medium subnet
/22255.255.252.01,0241,0221,019EKS node group subnet
/23255.255.254.0512510507Medium workload subnet
/24255.255.255.0256254251Class C, standard subnet, DB tier
/25255.255.255.128128126123Small DB tier
/26255.255.255.192646259Specialized service subnet
/27255.255.255.224323027VPC endpoint subnet
/28255.255.255.240161411AWS minimum subnet, TGW attach
/29255.255.255.24886Azure minimum, small P2P range
/30255.255.255.25242Standard P2P link
/31255.255.255.25422RFC 3021 P2P (no network/broadcast)
/32255.255.255.25511Single 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 255 octets.
  • The remainder is the number of leading 1 bits in the next octet.
  • Map the remainder using the octet table (below).
Leading 1sOctet valueMagic number (256 − value)
00256
1128128
219264
322432
424016
52488
62524
72542
82551

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.

PrefixSubnet maskWildcard mask
/24255.255.255.00.0.0.255
/22255.255.252.00.0.3.255
/16255.255.0.00.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:

ProviderReserved per subnetMinimum subnet
AWS VPC5/28
Azure VNet5/29
Google Cloud VPC4/29
Oracle Cloud3/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.