IPv4 Reverse Subnetting Trainer
Find the smallest classic IPv4 subnet that safely fits a required number of usable hosts.
Hosts → smallest subnet
Classic IPv4 model: one network address and one broadcast address are reserved. /31 and /32 are intentionally excluded from host-capacity exercises.
Smallest prefix
/27
Mask
255.255.255.224
Addresses total
32
Usable hosts
30
Host bits
5
27 + 2 = 29 → 32 = 2^5 → 32 − 5 = /27
Universal algorithm
- Take the required number of usable hosts and add 2.
- Round up to the nearest power of two.
- The exponent is the number of host bits.
- Prefix = 32 − host bits.
- Check that the resulting usable-host capacity is large enough.
HOSTS + 2 → next 2^n → 32 − n = prefix
Quick reference
| Required hosts | Prefix | Mask | Usable hosts |
|---|---|---|---|
| 1–2 | /30 | 255.255.255.252 | 2 |
| 3–6 | /29 | 255.255.255.248 | 6 |
| 7–14 | /28 | 255.255.255.240 | 14 |
| 15–30 | /27 | 255.255.255.224 | 30 |
| 31–62 | /26 | 255.255.255.192 | 62 |
| 63–126 | /25 | 255.255.255.128 | 126 |
| 127–254 | /24 | 255.255.255.0 | 254 |
| 255–510 | /23 | 255.255.254.0 | 510 |
| 511–1022 | /22 | 255.255.252.0 | 1022 |
XP0
Streak0
Accuracy—
Best streak0
Starter
0 / 100 XP
—
Choose the smallest correct prefix.
Keyboard: 1–4 answer, Enter next.
Score0
Streak0
Accuracy—
Round0/12
0 / 12
—
Choose the smallest correct prefix.
One attempt per round. Boundary values appear often.




