IPv4 Subnet Calculator
Enter an IPv4 address and CIDR prefix to calculate network ID, broadcast, host range, wildcard, and address counts.
Why network calculations matter
Network calculations are the foundation of reliable IP design. Whether you are building a home lab, segmenting a business network, or preparing for a certification exam, you need to know exactly how many addresses a subnet provides, where that subnet starts, and where it ends.
Good subnet math prevents overlap, minimizes broadcast noise, improves security boundaries, and makes troubleshooting dramatically easier. In short: if you can calculate networks quickly and accurately, you can design cleaner systems.
Core terms you should know
IP address
In IPv4, an address is 32 bits, usually written as four decimal octets (for example, 192.168.10.34).
CIDR prefix
The slash notation (like /27) tells you how many bits are reserved for the network portion. The remaining bits are available for host addresses.
Subnet mask
The subnet mask is the dotted-decimal representation of the prefix. Example: /27 = 255.255.255.224.
Network and broadcast
- Network address: the first address in the subnet (host bits all 0).
- Broadcast address: the last address in the subnet (host bits all 1).
How to perform subnet calculations manually
Let’s use 192.168.10.34/27.
- /27 means 27 network bits and 5 host bits.
- Host combinations: 25 = 32 total addresses per subnet.
- Traditional usable hosts: 32 - 2 = 30.
- Mask is 255.255.255.224, so block size in last octet is 32.
- Subnet boundaries are 0, 32, 64, 96, 128, 160, 192, 224.
- Address .34 falls in the 32–63 block.
Therefore:
- Network: 192.168.10.32
- Broadcast: 192.168.10.63
- Usable range: 192.168.10.33 - 192.168.10.62
Quick reference for common prefixes
| Prefix | Subnet Mask | Total Addresses | Usable Hosts (traditional) |
|---|---|---|---|
| /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 |
Other network calculations you should practice
1) Capacity planning
Start with the number of endpoints you need, add growth headroom, then choose the smallest prefix that still fits. This avoids wasting addresses and keeps routing tables tidy.
2) Summarization (route aggregation)
Summarization combines contiguous networks into a shorter prefix (for example, four /24 routes into a /22 when aligned). This improves routing scalability and stability.
3) Wildcard masks
Access control systems often use wildcard masks (inverse of subnet mask). Example: /24 mask 255.255.255.0 has wildcard 0.0.0.255.
4) Point-to-point links
/30 is classic for two-host links, while /31 is common in modern routed point-to-point environments where broadcast is unnecessary.
Common mistakes to avoid
- Confusing total addresses with usable host addresses.
- Ignoring alignment when subnetting or summarizing.
- Mixing decimal and binary logic mid-calculation.
- Forgetting reserved ranges, private ranges, or policy standards in your environment.
A practical workflow
- Define requirements (hosts, segments, growth).
- Choose prefixes from largest subnet need to smallest.
- Verify network and broadcast boundaries for each subnet.
- Document assignments and reserve future blocks intentionally.
- Validate with a calculator before deployment.
Final thought
Network calculations are not just exam skills—they are real operational skills. Accurate subnetting reduces outages, accelerates troubleshooting, and helps teams scale infrastructure with confidence.