Calculator
Example Data
| Example Network | CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|---|
| 192.168.10.0 | /24 | 255.255.255.0 | 256 | 254 |
| 10.20.30.0 | /26 | 255.255.255.192 | 64 | 62 |
| 172.16.5.0 | /30 | 255.255.255.252 | 4 | 2 |
| 203.0.113.8 | /31 | 255.255.255.254 | 2 | 2 |
Formula Used
- Host bits = 32 − prefix
- Total addresses = 2^(host bits)
- Usable hosts = total − 2 for most subnets
Special cases: /31 commonly provides 2 usable addresses for point-to-point links. /32 is a single host route.
How to Use This Calculator
- Select CIDR prefix or Subnet mask mode.
- Enter a prefix (0–32) or pick a valid mask.
- Optionally add a network IP to compute the address range.
- Press Calculate Hosts to view the result above.
- Use Download CSV or Download PDF for reporting.
FAQs
1) Why do most subnets subtract two addresses?
Typically one address is the network identifier and one is the broadcast address. These are not assigned to hosts on most IPv4 LAN subnets.
2) What makes /31 different?
A /31 creates a two-address block. For point-to-point links, many networks treat both as usable and do not use broadcast behavior.
3) What does /32 mean in practice?
A /32 represents a single IP host route. It is commonly used for loopbacks, host routes, and identifying a single endpoint.
4) Do I need to enter a network IP?
No. If you only need host counts, prefix or mask is enough. Adding a network IP lets the calculator derive network, broadcast, and usable ranges.
5) Why must the subnet mask be contiguous?
Standard IPv4 subnetting uses masks with all 1s followed by all 0s. Non-contiguous masks are unusual and unsupported by most tools and networks.
6) What is a wildcard mask used for?
A wildcard mask is the inverse of the subnet mask. It is commonly used in ACLs and routing filters to match address ranges efficiently.
7) Can this help with VLSM planning?
Yes. Try different prefix lengths to compare usable hosts per subnet. Then select prefixes that meet requirements while keeping your address space efficient.