Guides

How Subnetting Actually Works

Every IPv4 address is 32 bits long, and subnetting is simply the decision of how many of those bits identify the network versus how many identify an individual host on it. Get comfortable with that one idea and the rest of subnetting — CIDR notation, subnet masks, host counts — follows from it directly.

Network bits vs. host bits

Write an address like 192.168.1.10/24, and that /24 is telling you the first 24 bits are the network portion; the remaining 8 bits are the host portion. With 8 host bits, there are 2^8 = 256 possible values, giving 256 total addresses in that subnet — 254 usable once you subtract the network address (all host bits zero) and the broadcast address (all host bits one), which are both reserved.

Move to a /25, and you've taken one bit away from the host portion and given it to the network portion. That halves the subnet: 128 total addresses, 126 usable, but doubles the number of subnets you can carve out of the same address block. This is the fundamental trade-off in subnetting: more network bits means smaller, more numerous subnets; fewer network bits means larger, fewer subnets.

Why this matters in practice

When you're planning a VLAN for a new office floor, you're deciding how many devices realistically need addresses on that segment, then picking the smallest prefix that comfortably fits them with room to grow — not just grabbing a /24 out of habit. A /24 for a 10-device VLAN wastes 244 addresses that could have been allocated to other subnets; a /29 (6 usable hosts) for a segment that's about to grow to 20 devices means a painful re-addressing project later.

Subnet masks are the same information, written differently

A subnet mask like 255.255.255.0 is just the CIDR prefix expressed as four octets instead of a slash number — every bit in the network portion is set to 1, every host bit is set to 0. 255.255.255.0 in binary is 11111111.11111111.11111111.00000000, which is 24 ones followed by 8 zeros: exactly a /24. Some older equipment and documentation still expects dotted-decimal masks rather than CIDR notation, which is why both notations persist.

Checking your work

Rather than working this out by hand every time, our subnet calculator does the arithmetic instantly — enter an address and prefix, and it returns the network address, broadcast address, mask, and usable host range. It's the same math described above, just without the risk of an off-by-one error when you're doing it live during a maintenance window.