How to Calculate Subnets in Your Head Without Binary Math

Want to check your work as you read? The free calculator at activeitprep.com/subnet shows each step below. Subnetting has a reputation for being painful, mostly because most guides start by converting everything to binary. You can skip that. Once you know the Magic Number method, you can find a subnet's network ID, broadcast address, and usable range with simple decimal math. I used it to pass Network+, and it's what I teach. The Three Steps Find the interesting octet. This is the octet where the mask is neither 255 nor 0. For /25 it's the 4th octet, for /20 it's the 3rd, for /12 it's the 2nd. Find the block size. Block size is 256 minus the mask value in that octet. Another way to see it: halve 256 once for every bit borrowed in that octet. Count up by the block size. Start at 0 and count up until you pass the address's value in that octet. The multiple at or below it is the network ID. The broadcast is one less than the next multiple. The usable hosts are everythin

How to Calculate Subnets in Your Head Without Binary Math

Screenshot of the Active IT Prep subnetting calculator displaying Network ID, usable host range, broadcast ID, subnet mask, and Magic Number breakdown for 192.168.30.22/30

Want to check your work as you read? The free calculator at activeitprep.com/subnet shows each step below.

Subnetting has a reputation for being painful, mostly because most guides start by converting everything to binary. You can skip that. Once you know the Magic Number method, you can find a subnet's network ID, broadcast address, and usable range with simple decimal math. I used it to pass Network+, and it's what I teach.

The Three Steps

  1. Find the interesting octet. This is the octet where the mask is neither 255 nor 0. For /25 it's the 4th octet, for /20 it's the 3rd, for /12 it's the 2nd.
  2. Find the block size. Block size is 256 minus the mask value in that octet. Another way to see it: halve 256 once for every bit borrowed in that octet.
  3. Count up by the block size. Start at 0 and count up until you pass the address's value in that octet. The multiple at or below it is the network ID. The broadcast is one less than the next multiple. The usable hosts are everything between.

Example 1: 192.168.14.77/27

  • /27 borrows 3 bits in the 4th octet (27 - 24 = 3)
  • Halve 256 three times: 256 / 2 / 2 / 2 = 32, so the block size is 32
  • Mask: 256 - 32 = 224, so 255.255.255.224
  • Count by 32: 0, 32, 64, 96. The value 77 sits in the 64 block
  • Network ID: 192.168.14.64
  • Next block starts at 96, so the Broadcast is 192.168.14.95
  • Usable range: 192.168.14.65 to 192.168.14.94 (30 hosts)

Example 2: When the interesting octet isn't the last one

Take 10.45.130.9/20.

  • /20 borrows 4 bits in the 3rd octet (20 - 16 = 4), so the interesting octet is the third
  • Block size: 256 / 2 / 2 / 2 / 2 = 16, mask 255.255.240.0
  • Count by 16 in the 3rd octet: ..., 112, 128, 144. The value 130 sits in the 128 block
  • Network ID: 10.45.128.0
  • Next block starts at 144, so the Broadcast is 10.45.143.255
  • Usable range: 10.45.128.1 to 10.45.143.254 (4,094 hosts)

Everything after the interesting octet is 0 for the network and 255 for the broadcast.

Quick Reference Table

CIDR Mask (Last Octet) Block Size Usable Hosts
/25 128 128 126
/26 192 64 62
/27 224 32 30
/28 240 16 14
/29 248 8 6
/30 252 4 2

Usable hosts is always total addresses minus 2, because the first address is the network ID and the last is the broadcast. Two special cases: /31 (point-to-point links, RFC 3021) has no network or broadcast address, and /32 is a single host.

Practice Problems

Try these on paper:

  1. 172.16.50.200/26
  2. 192.168.1.100/28
  3. 10.20.77.5/21

Click to view answers

  1. Network: 172.16.50.192 | Broadcast: 172.16.50.255 | Usable: .193 to .254 (62 hosts)
  2. Network: 192.168.1.96 | Broadcast: 192.168.1.111 | Usable: .97 to .110 (14 hosts)
  3. Network: 10.20.72.0 | Broadcast: 10.20.79.255 | Usable: 10.20.72.1 to 10.20.79.254 (2,046 hosts)

Test Your Subnetting Speed

If you want more reps, there are 20 graded practice problems in the free subnet calculator at activeitprep.com/subnet. It breaks down every calculation step-by-step with no signup or ads required.

Looking to go beyond standard multiple choice? Test your hands-on Network+ skills on live virtual console configurations at activeitprep.com/networking-simulator.

Share