Subnetting in your head: the block-size method
In short: Find the "interesting" octet, work out the block size (256 minus the mask value in that octet), and count up in blocks. Everything else follows from that.
The method in four steps
- Find the interesting octet: the first octet where the mask isn't 255.
- Work out the block size: 256 minus the mask value in that octet.
- Find the network: the largest multiple of the block size that's less than or equal to the IP's value in that octet.
- Find the broadcast: the next network minus one.
Worked example: 172.16.45.130/26
- /26 is
255.255.255.192, so the interesting octet is the 4th. - Block size: 256 − 192 = 64. Networks start at .0, .64, .128, .192.
- 130 falls in the block starting at .128, so the network is
172.16.45.128. - The next block starts at .192, so the broadcast is
172.16.45.191. - Usable hosts:
.129to.190, which is 26 − 2 = 62.
Prefixes worth memorising
| Prefix | 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 |
Sizing a subnet for a requirement
Need at least N hosts? Find the smallest number of host bits h where 2h − 2 ≥ N. The prefix is 32 − h. For 50 hosts, h = 6 (62 hosts), so use a /26.
Practise until it's automatic: try the subnetting practice tool and the branch office challenge.
Key takeaways
- Block size = 256 − mask value in the interesting octet.
- Network = the block the address falls into; broadcast = next block − 1.
- Usable hosts = 2^host bits − 2 (except /31 and /32).
Tracks your learning on this device only. See your progress on the learning paths.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.