How-To 5 min read

Subnetting Cheat Sheet: /8 Through /32 Reference Guide

A quick-reference guide to every CIDR prefix length from /8 to /32 — total IPs, usable hosts, subnet masks, and common use cases for each.

subnetting reference cheat-sheet prefix

One of the most useful things a network engineer can memorise is what each CIDR prefix length actually means in terms of address count. This guide covers the most commonly used prefix lengths with the information you need to choose and reason about subnet sizes quickly.

The Core Formula

Every CIDR calculation starts from one fact: a /N block contains 2(32-N) total IP addresses. Usable host addresses subtract 2 from that total — one for the network address and one for the broadcast address. (Exception: /31 has 2 usable hosts per RFC 3021, and /32 represents a single host.)

Common Prefix Lengths

  • /8 — 16,777,216 total IPs, 16,777,214 usable. Entire Class A. Used for the 10.0.0.0/8 private range.
  • /16 — 65,536 total IPs, 65,534 usable. Typical VPC or corporate network. The 192.168.0.0/16 private range.
  • /20 — 4,096 total IPs, 4,094 usable. AWS default VPC subnet in each Availability Zone.
  • /24 — 256 total IPs, 254 usable. The single most common subnet size. Equivalent to the old Class C.
  • /25 — 128 total IPs, 126 usable. Splits a /24 into two equal halves.
  • /26 — 64 total IPs, 62 usable. Four equal subnets from one /24.
  • /27 — 32 total IPs, 30 usable. Eight equal subnets from one /24.
  • /28 — 16 total IPs, 14 usable. Small group of servers or a dedicated management segment.
  • /29 — 8 total IPs, 6 usable. Small cluster or a pair of systems with a handful of spare addresses.
  • /30 — 4 total IPs, 2 usable. Classic point-to-point WAN link between two routers.
  • /31 — 2 total IPs, 2 usable (RFC 3021). Modern point-to-point link — no broadcast needed.
  • /32 — 1 IP, 1 usable host. A single host route. Used in firewall rules to target one specific address.

Choosing the Right Size

Work backwards from your host count. Add 30% headroom for growth, then find the smallest /N that accommodates that number. For AWS subnets, always account for the 5 reserved addresses AWS takes from every subnet — so a /28 gives you only 11 usable addresses in AWS, not 14. See the AWS VPC subnetting guide for the full breakdown.

Memorising the Key Values

If you only memorise three: a /24 has 256 addresses, a /16 has 65,536, and each step down in prefix length doubles the count. Each step up halves it. From that anchor you can calculate any prefix length mentally. For anything non-standard, the CIDR calculator handles the arithmetic instantly.