Class C gives you 8 bits to work with in the last octet. Every subnet you carve out is a trade: bits you use for networks are bits you give up for hosts. Work through five stages below to see that trade from every angle.
Subnetting is bit manipulation wearing a decimal costume. Before touching a mask, get comfortable flipping bits and watching the decimal value respond — and the reverse.
Click any bit to flip it. Place values shown above each bit: 128 · 64 · 32 · 16 · 8 · 4 · 2 · 1.
Every subnetting problem — Class A, B, or C — can be solved the same way, in under a minute, without memorizing a single table. This is the method network engineers actually use on the job and on certification exams.
An IP address is 32 bits split into a network portion and a host portion. The CIDR number (the /24 in 192.168.1.0/24) simply tells you how many of those 32 bits belong to the network. Everything left over belongs to hosts. A subnet mask is just that same split written out in dotted-decimal — /24 and 255.255.255.0 are two ways of saying the exact same thing.
Look at the subnet mask and find the interesting octet — the first octet, left to right, that isn't 255. Subtract that octet's value from 256. The result is the magic number: the size of every block in that octet, and the amount the network address jumps by each time.
| CIDR | Subnet mask | Magic number | Total usable hosts |
|---|
Notice the pattern: the magic number and the mask value in that octet always add up to 256.
*At /24, the entire last octet is host — network and broadcast simply become .0 and .255.
A /20 mask is 255.255.240.0. The interesting octet is the third one (240), so the magic number is 256 − 240 = 16. The multiples of 16 around 85 are 80 and 96 — 85 falls in the 80 block.
| Network ID | 172.16.80.0 |
| Broadcast address | 172.16.95.255 |
| First usable host | 172.16.80.1 |
| Last usable host | 172.16.95.254 |
| Next network | 172.16.96.0 |
Same method whether the interesting octet is the 2nd, 3rd, or 4th — only the position changes.
Now put the method to work. A new IP address and CIDR every time — solve for all five attributes, octet by octet, exactly like you would on an exam.
| Attribute | Your answer | Result |
|---|
You won't always get to choose how a network is subnetted — usually you're handed a host address and a CIDR and have to work out where it lives. Given the target below, fill in the five blanks: network ID, subnet mask, broadcast address, first usable host, and last usable host.
The row matching your current target's CIDR is highlighted. These are the only numbers you actually need to memorize for subnetting.
| Bits borrowed | 2ⁿ (subnets) | Bits left for hosts | Usable hosts (2ⁿ − 2) |
|---|
More subnet bits mean more subnets and fewer hosts per subnet. Your current target's position is the bright bar in each chart.
Take the borrow count from Stage 2 and lay it against a real network address. This table is what you'd hand to a network diagram: every subnet, its usable range, and its broadcast address.
| # | Network address | First usable host | Last usable host | Broadcast address |
|---|
A fresh requirement, a fresh network, every time you click "New problem." Work it out on paper first, then fill in your answers below.
Class B starts you off with more room to work with: the default mask is /16, meaning only the first two octets are fixed as network. That leaves a full 16 bits — spanning the 3rd and 4th octets — for you to divide between subnets and hosts. Addresses in this class run from 128.0.0.0 through 191.255.255.255.
All four use the same starting network, 172.20.0.0/16, so you can see exactly how the split point changes the outcome. Click a row to load a fresh practice address using that split.
| Scenario | Bits borrowed | New mask | CIDR | Subnets created | Hosts / subnet | Block size |
|---|