Subnetting Cheat Sheet

The CIDR table, and the method for doing it in your head when there's no calculator.

Subnetting looks like math. It's really just memorizing eight numbers and knowing which column to look in. Here's the table, then the trick.

The CIDR table

CIDRSubnet maskAddressesUsable hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01,0241,022
/21255.255.248.02,0482,046
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

Usable hosts are always two fewer than total addresses — one goes to the network ID, one to the broadcast. The exceptions: /31 is a special case for point-to-point links (2 usable, no broadcast, per RFC 3021), and /32 is a single host, used for loopbacks and host routes.

The eight numbers worth memorizing

Every mask octet is one of these: 128, 192, 224, 240, 248, 252, 254, 255. Each step doubles the subnets and halves the hosts. If you know that row, you know subnetting.

The block-size trick. Take 256 minus the interesting octet of the mask. That's your block size — the increment your subnets jump by. For /26 (mask 192): 256 − 192 = 64. So subnets start at .0, .64, .128, .192. That's the whole method.

Working an example in your head

Question: what network is 192.168.1.100/26 in, and what's its range?

  1. Block size: /26 → mask 192 → 256 − 192 = 64.
  2. Count up in 64s until you pass 100: 0, 64, 128. You passed it — so back up one.
  3. Network: 192.168.1.64
  4. Broadcast: next block minus one → 192.168.1.127
  5. Usable range: 192.168.1.65 – 192.168.1.126 (62 hosts)

That's it. No binary conversion, no calculator. Find the block size, count up in it, back up one.

How many hosts do I need?

Work backwards with 2ⁿ − 2, where n is the number of host bits left:

Ranges you should recognize on sight

RangeWhat it is
10.0.0.0/8Private (RFC 1918) — the big one
172.16.0.0/12Private — covers 172.16 through 172.31
192.168.0.0/16Private — home and small office
169.254.0.0/16Link-local (APIPA). Seeing this means DHCP failed.
127.0.0.0/8Loopback
Troubleshooting tell: a machine sitting on a 169.254 address didn't get a DHCP lease. Check the DHCP server, the scope, or the cable/VLAN before you touch anything else.
Want this as a printable sheet — with practice problems?

Subnetting & CIDR Cheat Sheet + Practice Problems. One page to pin up, plus worked problems to drill before an exam or interview.

Get the sheet — $4 →

Pairs well with the ports and protocols reference — the other thing you'll be asked to recite.