Updated 8 hours ago
When you see 192.168.1.0/24, you're looking at a question: which addresses belong together? Subnet calculation isn't abstract math—it's what every device does, constantly, to answer: "Can I talk to this address directly, or do I need a router?"
What Subnet Ranges Tell You
Given an IP address with CIDR notation like 192.168.5.0/24, you want to find:
- Network address — Where this neighborhood starts (can't assign to hosts)
- Broadcast address — Where it ends (can't assign to hosts)
- Usable host range — Every address between them that actual devices can use
- Total capacity — How many devices fit in this space
The Binary Foundation
IP addresses are 32-bit binary numbers. The dotted decimal format exists for humans, but networks think in binary. When you understand this, everything else becomes obvious.
What CIDR Notation Really Means
The /24 in 192.168.5.0/24 means "the first 24 bits identify the network." The remaining bits (32 - 24 = 8) identify hosts within that network.
The subnet mask marks this division:
The subnet mask is a stencil. Lay it over any IP address, and it reveals which neighborhood that address belongs to.
Finding the Network Address
The network address has all host bits set to 0. You find it by performing a binary AND between the IP address and subnet mask—wherever the mask has a 1, keep the IP bit; wherever the mask has 0, the result is 0.
Example: What network does 192.168.5.85/24 belong to?
The host bits (last 8) became 0. This is the network address—the start of the range.
Finding the Broadcast Address
The broadcast address has all host bits set to 1. Take the network address and flip every host bit to 1.
Finding Usable Hosts
Everything between network and broadcast can be assigned:
When the Subnet Boundary Isn't Obvious
Let's work through 10.50.100.75/22—where the subnet splits the third octet.
Notice the range spans from 100 to 103 in the third octet. The binary view shows why—those last 2 bits of the third octet are part of the host portion, so they count through four values (00, 01, 10, 11). Subnet boundaries don't respect octet boundaries.
The Quick Math Method
Once you understand the binary foundation, you can calculate most subnets mentally.
The Block Size Pattern
Subnet ranges divide address space into equal blocks. The block size comes from the number of host bits.
The block size tells you where subnet boundaries fall:
Finding Which Subnet an IP Belongs To
Divide the relevant octet by the block size.
Example: 192.168.5.85/27
Quick Reference for Common Subnets
Note: /31 networks (2 addresses) are a special case for point-to-point links only (RFC 3021). They don't reserve network and broadcast addresses—both can be assigned to the two endpoints.
Dividing an Office Network
You have 10.20.30.0/24 and need 4 departmental subnets.
Each department is its own broadcast domain with 62 usable addresses. They can talk to each other through a router, but broadcasts stay local to each subnet.
Reference Tables
Which Octet Changes?
- /24 or larger (/25-/32) — Only the 4th octet changes
- /16 to /23 — The 3rd octet changes
- /8 to /15 — The 2nd octet changes
- Less than /8 — The 1st octet changes
Partial Octet Mask Values
Powers of 2
Verify Your Work
After calculating, check:
- Network address has all host bits = 0
- Broadcast address has all host bits = 1
- First usable = Network + 1
- Last usable = Broadcast - 1
- Total addresses = 2^(host bits)
Frequently Asked Questions About Subnet Calculation
Was this page helpful?