Subnetting Cheat Sheet: CIDR, Masks, Wildcards in One Page
The full subnetting reference in a single table: every CIDR prefix from /16 to /30 with its subnet mask, usable host count, wildcard mask and binary view. Below the table are worked examples showing how to use each row — placing addresses, sizing subnets, writing ACLs and summarising routes. Free, no sign-up, and it prints cleanly on one page.
The one-page reference
Tip: memorise the /24–/30 rows cold — they answer most exam questions. Everything above /24 is just the same pattern one octet up.
| CIDR | Subnet mask | Wildcard mask | Usable hosts | Block size | Mask (binary) |
|---|---|---|---|---|---|
/16 | 255.255.0.0 | 0.0.255.255 | 65,534 | 256 (3rd octet) | 11111111.11111111.00000000.00000000 |
/17 | 255.255.128.0 | 0.0.127.255 | 32,766 | 128 (3rd octet) | 11111111.11111111.10000000.00000000 |
/18 | 255.255.192.0 | 0.0.63.255 | 16,382 | 64 (3rd octet) | 11111111.11111111.11000000.00000000 |
/19 | 255.255.224.0 | 0.0.31.255 | 8,190 | 32 (3rd octet) | 11111111.11111111.11100000.00000000 |
/20 | 255.255.240.0 | 0.0.15.255 | 4,094 | 16 (3rd octet) | 11111111.11111111.11110000.00000000 |
/21 | 255.255.248.0 | 0.0.7.255 | 2,046 | 8 (3rd octet) | 11111111.11111111.11111000.00000000 |
/22 | 255.255.252.0 | 0.0.3.255 | 1,022 | 4 (3rd octet) | 11111111.11111111.11111100.00000000 |
/23 | 255.255.254.0 | 0.0.1.255 | 510 | 2 (3rd octet) | 11111111.11111111.11111110.00000000 |
/24 | 255.255.255.0 | 0.0.0.255 | 254 | 256 | 11111111.11111111.11111111.00000000 |
/25 | 255.255.255.128 | 0.0.0.127 | 126 | 128 | 11111111.11111111.11111111.10000000 |
/26 | 255.255.255.192 | 0.0.0.63 | 62 | 64 | 11111111.11111111.11111111.11000000 |
/27 | 255.255.255.224 | 0.0.0.31 | 30 | 32 | 11111111.11111111.11111111.11100000 |
/28 | 255.255.255.240 | 0.0.0.15 | 14 | 16 | 11111111.11111111.11111111.11110000 |
/29 | 255.255.255.248 | 0.0.0.7 | 6 | 8 | 11111111.11111111.11111111.11111000 |
/30 | 255.255.255.252 | 0.0.0.3 | 2 | 4 | 11111111.11111111.11111111.11111100 |
Usable hosts = 2(32 − prefix) − 2. The minus 2 removes the reserved network and broadcast addresses. Bold bits in the binary column are the network (1) portion; plain bits are the host (0) portion.
How to read each row
Every row in the table is built from one number — the CIDR prefix. Once you can move between the prefix and any column, subnetting stops being a chore and becomes a lookup.
- CIDR prefix → mask: the prefix is the count of 1-bits in the mask. /26 = 26 ones followed by 6 zeros = 255.255.255.192. Full binary is in the table's last column.
- Prefix → usable hosts: subtract the prefix from 32 to get the host bits, then 2bits − 2. For /27: 32 − 27 = 5 host bits → 25 − 2 = 30 usable hosts.
- Mask → wildcard: subtract each mask octet from 255. 255.255.255.224 → 0.0.0.31. Wildcards appear in ACLs and OSPF network statements — the exam loves testing whether you can flip between the two.
- Mask → block size: 256 minus the interesting octet (the first octet that isn't 255 or 0). For 255.255.255.192 the interesting octet is 192, so the block size is 64 — subnets step in 64s: 0, 64, 128, 192. For /16–/23 the interesting octet is the third, which is why the table notes "(3rd octet)".
- Moving between rows: each step down the table halves the host count and doubles the number of subnets. /26 = 62 hosts, /27 = 30, /28 = 14, /29 = 6, /30 = 2 — the whole ladder is just halving.
For an interactive version of this table with a printable layout, see the CIDR cheat sheet tool.
Worked examples: using the table like an exam tool
Each example below names the exact table row it uses. Cover the answer, do the lookup yourself, then check.
1. 192.168.10.77/26 — find the subnet, broadcast and usable range.
Table row /26: block size 64, so subnets step 0, 64, 128, 192 in the last octet. 77 sits between 64 and 128 → subnet 192.168.10.64/26. Broadcast = 64 + 64 − 1 = 192.168.10.127. Usable range .65–.126 — and the row confirms 62 usable hosts.
2. Write an ACL line permitting the 192.168.30.0/27 subnet.
Table row /27: the wildcard column reads 0.0.0.31. So: access-list 10 permit 192.168.30.0 0.0.0.31. Any time you see a wildcard in an exam ACL question, read the subnet mask off the row, then read the wildcard from the same row.
3. A branch office needs 40 hosts. What's the smallest subnet you can give it?
Scan the Usable hosts column from the bottom up, picking the first row whose count reaches 40: /30 gives 2, /29 gives 6, /28 gives 14, /27 gives 30 — all too small. The first row that fits is /26 with 62 usable hosts (mask 255.255.255.192). Always pick the first row whose usable count reaches your requirement — nothing bigger.
4. 172.16.9.200/20 — what's the network address?
Table row /20: block size 16 in the third octet. Third-octet subnets step 0, 16, 32… 9 falls in the 0 block → network 172.16.0.0/20, broadcast 172.16.15.255. Note the trap: the block size applies to the interesting octet, not the last one.
5. Summarise 10.4.0.0/24, 10.4.1.0/24, 10.4.2.0/24 and 10.4.3.0/24 as one route.
Four contiguous /24s aligned on a multiple of 4. Each doubling of subnets shortens the prefix by one bit: two subnets = /23, four = /22. Table row /22 confirms the mask 255.255.252.0 — covering 10.4.0.0–10.4.3.255 with nothing extra and nothing missing.
6. Configure OSPF on the 192.168.1.0/30 point-to-point link.
Table row /30: wildcard 0.0.0.3 → network 192.168.1.0 0.0.0.3 area 0. The row also confirms why /30 is the standard point-to-point mask: 2 usable hosts, exactly one per router.
Binary bit values (the other half of the table)
If a question gives you a mask you don't recognise, build it from bit values. Each octet's bits are worth 128, 64, 32, 16, 8, 4, 2, 1 left to right:
| Interesting octet | Binary | Maths | CIDR row |
|---|---|---|---|
128 | 10000000 | 128 | /25 |
192 | 11000000 | 128 + 64 | /26 |
224 | 11100000 | 128 + 64 + 32 | /27 |
240 | 11110000 | 128 + 64 + 32 + 16 | /28 |
248 | 11111000 | 128 + 64 + 32 + 16 + 8 | /29 |
252 | 11111100 | 128 + 64 + 32 + 16 + 8 + 4 | /30 |
Building binary fluency is the real exam skill behind this table — our binary–decimal converter is the fastest way to drill it, and the subnetting drill tests you against the clock.
Exam tips: making the table stick
- Learn the host ladder first: 254 – 126 – 62 – 30 – 14 – 6 – 2. Recite it until it's automatic; half of all sizing questions are answered by this list alone.
- Memorise block sizes with the masks: /25 = 128, /26 = 64, /27 = 32, /28 = 16, /29 = 8, /30 = 4. These place any address in its subnet in seconds.
- Check the octet: masks below /24 borrow from the third octet — a /20 block size of 16 applies to the third octet, not the fourth. Most "which subnet" mistakes come from stepping in the wrong octet.
- Watch the boundaries: an address like 192.168.1.63/26 is the broadcast of the previous subnet (192.168.1.0/26), not a host in 192.168.1.64/26. The block-size column makes these traps visible.
- VLSM = largest first: when carving subnets of different sizes from one block, allocate the biggest requirement first, then fit smaller rows into the gaps — otherwise addresses strand and can't be reclaimed.
For the full subnetting topic with key exam points, see our CCNA subnetting cheat sheet and the subnetting practice questions. To check any calculation instantly, use the subnet calculator — it also shows the binary view, exactly like this table.
More free tools: Subnet calculator CIDR cheat sheet Subnetting drill Binary–decimal converter Flashcards
Know the table? Prove it.
Subnetting is one topic of six on the CCNA 200-301. Take the free 25-question mock test — no sign-up — and see how fast your subnetting really is. One subscription (£5/month or £39/year) unlocks all 370 exam-style questions, 20 in-browser labs and 300 flashcards across all 10 certifications.
Start the free mock test →