Subnetting Without a Calculator
CIDR notation demystified. Learn the handful of powers of two that let you split and size networks in your head, with a reference table you'll actually remember.
Subnetting scares people because it is taught as arithmetic. It is really just counting in powers of two. Learn one small table and you can do it in your head.
What the /n actually means
An IPv4 address is 32 bits. In CIDR notation, /24 means "the first 24 bits are the network, the remaining 8 identify hosts." The smaller the number after the slash, the bigger the network.
192.168.1.0/24
└──────┬─────┘ └┬┘
network host part = 32 − 24 = 8 bits → 256 addressesThe only table you need
Each row is a "mask octet" value and how many addresses that block holds.
| CIDR | Mask | Block size | Usable hosts* |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
*Usable = block size − 2 (one network address, one broadcast). The mask values are just 256 − block size.
The two-step mental method
Question: which subnet does 192.168.1.100/26 belong to, and what's its range?
- Block size for /26 is 64 (from the table).
- Count in steps of 64 in the last octet: 0, 64, 128, 192.
100falls between 64 and 128, so it lives in the 64 block.
So the subnet is 192.168.1.64/26:
- Network address:
.64 - First usable host:
.65 - Last usable host:
.126 - Broadcast:
.127
That's it. No binary conversion, no long division.
Splitting a network
You have 10.0.0.0/24 and need four equal subnets. Four = 2², so borrow 2 host bits: /24 + 2 = /26, block size 64:
10.0.0.0/26 → .0 – .63
10.0.0.64/26 → .64 – .127
10.0.0.128/26 → .128 – .191
10.0.0.192/26 → .192 – .255Need subnets sized for ~30 hosts each? 30 usable needs block size 32 → /27. Always round up to the next power of two.
IPv6, briefly
IPv6 subnetting is mercifully simpler in practice: you are almost always handed a /64 per network and everything is hex. The CIDR logic is identical — it is just that addresses are so abundant you rarely carve below /64.
Takeaways
- The number after the slash counts network bits; 32 minus it gives host bits.
- Memorise the block-size table (256 → 2, halving each step).
- Block size is both the subnet count step and the key to every range question.