Every IPv4 subnet mask, the usable host count it gives you, the wildcard mask, and the fastest way to work a subnet by hand. This subnetting cheat sheet is one page you can scan, print, and pin above the desk, no calculator needed.
It covers the CIDR to subnet mask table, hosts per subnet, the magic-number method, wildcard (inverse) masks, address class ranges, and the VLSM rules. It is the quick-reference companion to the CCNA 200-301 study path; for the worked method behind each number, jump to the full guides linked below.
Current as of June 2026, aligned to the CCNA 200-301 exam blueprint.
A one-page PDF with the full subnet mask table, host counts, the magic-number method, and the VLSM rules. Free to print and keep beside you while you practice.
Download the PDF cheat sheetSubnetting cheat sheet: the subnet mask table
This is the table you reach for most. It subnets a /24 down to a /30, the range CCNA tests hardest. Block size is the gap between subnet IDs in the last octet, which is also the count of addresses in each subnet.
| CIDR | Subnet mask | Wildcard | Usable hosts | Block size |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 254 | 256 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 | 128 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 | 64 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 | 32 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 | 16 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 | 8 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 | 4 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 (point-to-point, RFC 3021) | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 (host route) | 1 |
For bigger blocks, the same pattern walks up the octets. Usable hosts is always 2 raised to the host bits, minus 2 for the network and broadcast addresses.
| CIDR | Subnet mask | Usable hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /16 | 255.255.0.0 | 65,534 |
| /19 | 255.255.224.0 | 8,190 |
| /20 | 255.255.240.0 | 4,094 |
| /21 | 255.255.248.0 | 2,046 |
| /22 | 255.255.252.0 | 1,022 |
| /23 | 255.255.254.0 | 510 |
Hosts needed to subnet mask
Sizing a subnet from a host count is the core CCNA skill. Pick the smallest mask where usable hosts is at least what the segment needs. Borrow the fewest host bits that still fit, so the rest of the address space stays free.
| Hosts needed | Host bits | Mask | Usable hosts |
|---|---|---|---|
| 2 | 2 | /30 | 2 |
| up to 6 | 3 | /29 | 6 |
| up to 14 | 4 | /28 | 14 |
| up to 30 | 5 | /27 | 30 |
| up to 62 | 6 | /26 | 62 |
| up to 126 | 7 | /25 | 126 |
| up to 254 | 8 | /24 | 254 |
| up to 510 | 9 | /23 | 510 |
| up to 1022 | 10 | /22 | 1022 |
The magic-number method
The magic number is the block size in the interesting octet, and it equals 256 minus the mask value in that octet. Subnets start at multiples of it. Memorize this column and you can subnet in your head.
| Mask octet | Borrowed bits | Magic number (block) |
|---|---|---|
| 128 | 1 | 128 |
| 192 | 2 | 64 |
| 224 | 3 | 32 |
| 240 | 4 | 16 |
| 248 | 5 | 8 |
| 252 | 6 | 4 |
| 254 | 7 | 2 |
Wildcard (inverse) masks
ACLs and OSPF network statements take a wildcard mask, not a subnet mask. The wildcard is the inverse: subtract each subnet-mask octet from 255.
| CIDR | Subnet mask | Wildcard mask |
|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 |
| /25 | 255.255.255.128 | 0.0.0.127 |
| /26 | 255.255.255.192 | 0.0.0.63 |
| /27 | 255.255.255.224 | 0.0.0.31 |
| /28 | 255.255.255.240 | 0.0.0.15 |
| /29 | 255.255.255.248 | 0.0.0.7 |
| /30 | 255.255.255.252 | 0.0.0.3 |
| /16 | 255.255.0.0 | 0.0.255.255 |
Address classes and private ranges
Classful boundaries still drive default masks and the private ranges from RFC 1918. The first octet of the address decides the class.
| Class | First octet | Default mask | Private range (RFC 1918) |
|---|---|---|---|
| A | 1 to 126 | /8 | 10.0.0.0/8 |
| B | 128 to 191 | /16 | 172.16.0.0/12 |
| C | 192 to 223 | /24 | 192.168.0.0/16 |
| D (multicast) | 224 to 239 | n/a | n/a |
| E (reserved) | 240 to 255 | n/a | n/a |
Worth keeping nearby: 127.0.0.0/8 is loopback, and 169.254.0.0/16 is the link-local (APIPA) range a host self-assigns when DHCP fails.
VLSM rules
Variable-length subnet masking sizes each subnet to its own host count instead of forcing one mask everywhere. Six rules cover it.
| Rule | What it does |
|---|---|
| Pick the mask | Smallest mask where usable hosts is at least the count needed |
| Allocate largest first | Biggest subnet, then down to the /30 links |
| Start after the last broadcast | Next subnet ID is the previous broadcast plus 1 |
| Overlap check | Next subnet ID must be above the previous broadcast |
| Protocol support | RIPv2, OSPFv2, EIGRP carry the mask; RIPv1 does not |
| Verify in IOS | “variably subnetted” in show ip route confirms it |
How to use this subnetting cheat sheet
How do you find the network and broadcast address?
AND the IP with the mask to get the network address. The broadcast is the network plus the block size minus 1. Take 192.168.1.50/27: the /27 block is 32, so the network rounds down to 192.168.1.32, the broadcast is 192.168.1.63, and the usable range is 192.168.1.33 to 192.168.1.62. The full method, AND operation and all, is in the step-by-step subnetting guide.
How do you pick a subnet mask from a host count?
Find the smallest mask whose usable hosts is at least what the segment needs. A 26-user LAN needs at least 30 usable, so /27 fits and /28 (14) does not. Work the same logic per segment when you subnet by network requirements.
What is the fastest way to subnet by hand?
Use the magic number. Subtract the interesting mask octet from 256 to get the block, then count up in blocks until you pass the address you care about. The subnet ID is the multiple just below it. No binary, no calculator.
When do you need VLSM?
Whenever segments differ in size and you want zero wasted addresses, give each its own mask. Size them, allocate the largest first, and pack them with no gaps. The full worked design is in VLSM subnetting explained.
Print the one-page PDF and work through the practice drills below until the tables are muscle memory.
Download the PDF cheat sheetPractice subnetting
A cheat sheet gets you the numbers; drilling makes them automatic. The trainer generates an endless stream of network, broadcast, and host-range questions with instant checking.
Flip through the core facts until the masks, host counts, and block sizes are instant recall. Mark each card you know, then grab the Anki deck to keep reviewing on your phone.
Then test the decisions the tables encode: mask choice, block size, and the VLSM judgement calls, each answer worked out.
Pin the PDF where you can see it, run the trainer until you stop reaching for the tables, and subnetting stops being the part of the exam you dread.