Home › Guides › Subnetting cheat sheet

CCNA Subnetting Cheat Sheet

Everything you need to subnet fast in the exam: the mask table, the powers of two, the magic-number method, and wildcard masks — with worked examples.

Updated October 2026 · ~7 min read

The subnet mask table (memorize this)

This is the single most useful thing to know cold. It covers every subnet inside one octet.

CIDRSubnet maskBlock sizeUsable hostsWildcard
/24255.255.255.02562540.0.0.255
/25255.255.255.1281281260.0.0.127
/26255.255.255.19264620.0.0.63
/27255.255.255.22432300.0.0.31
/28255.255.255.24016140.0.0.15
/29255.255.255.248860.0.0.7
/30255.255.255.252420.0.0.3
/31255.255.255.25422*0.0.0.1
/32255.255.255.255110.0.0.0

* A /31 has no network or broadcast address in the usual sense; by RFC 3021 both addresses are usable on point-to-point links. A /32 is a single host route.

Powers of two

Subnetting is just powers of two. Know these forward and backward:

2^1=2   2^2=4   2^3=8   2^4=16
2^5=32  2^6=64  2^7=128 2^8=256

The mask octet values follow the same pattern (add from the left): 128, 192, 224, 240, 248, 252, 254, 255.

The two formulas

Example: a /26 has 32 − 26 = 6 host bits → 26 = 64 addresses → 62 usable hosts.

The magic-number method

This is the fastest way to find a subnet's network, broadcast, and host range.

  1. Find the interesting octet — the one the mask doesn't fill with 255 or 0.
  2. Magic number = 256 − (mask value in that octet). This is also your block size.
  3. Count in blocks (0, block, 2×block…) until you pass the IP's value — the subnet starts at the last multiple you didn't pass.
  4. Broadcast = next subnet − 1. Usable range = network+1 to broadcast−1.

Worked example: 192.168.1.100/26

Wildcard masks (for ACLs and OSPF)

A wildcard mask is the inverse of the subnet mask — subtract each octet from 255. The CCNA uses them in access lists and OSPF network statements.

Subnet mask:  255.255.255.192   (/26)
Wildcard:       0.  0.  0. 63

! OSPF example — advertise the 192.168.1.64/26 network
R1(config-router)# network 192.168.1.64 0.0.0.63 area 0

Quick self-check

Try these, then verify with the table above:

  1. How many usable hosts in a /28? (14)
  2. What's the block size of a /27? (32)
  3. Network and broadcast for 10.0.0.200/29? (network 10.0.0.200, broadcast 10.0.0.207)

Drill subnetting until it's automatic

CLI Recall has a subnetting trainer that generates unlimited practice problems and checks your answers instantly — the only way this sticks is reps.

Try the subnetting trainer free

Related guides