IP Subnet Calculator
Splitting an IPv4 Address Into Network and Host
Every IPv4 address carries two pieces of information at once: which network it belongs to, and which host it identifies within that network. The subnet mask (or its CIDR shorthand, like /24) is what draws the line between the two. Get the mask wrong and two devices that should be able to talk directly end up routed through a gateway unnecessarily — or worse, two networks that should be separate end up overlapping.
The Formula
This calculator builds an IPv4 network from the address and mask/CIDR you supply, then derives every other value from it:
Broadcast Address = Network Address OR Wildcard Mask
Total Addresses = 2^(32 − CIDR prefix length)
Usable Hosts = Total Addresses − 2 (for prefixes /1–/30)
The −2 accounts for the network address and broadcast address, neither of which can be assigned to a host. A /31 network is a documented exception (point-to-point links, 2 usable addresses, no broadcast) and a /32 is a single host address.
Where Subnetting Matters
- Network design — splitting a large allocated block into smaller subnets for different departments, VLANs, or sites without wasting address space.
- Firewall and ACL rules — writing rules that match an entire subnet (e.g.
10.0.5.0/24) rather than every device individually. - Troubleshooting — confirming whether two hosts are on the same broadcast domain, which determines whether they can communicate without a router.
- Capacity planning — choosing a prefix length that leaves headroom for future devices without over-allocating a scarce address block.
Common IPv4 Prefixes
| Prefix | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /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 |
/16 (255.255.0.0) gives 65,536 total addresses; /8 (255.0.0.0) gives 16,777,216 — both far larger than a typical local network needs.
How to Use This Calculator
- Enter the IP Address, for example
192.168.1.10. - Enter the Subnet Mask or CIDR value, either as a dotted mask (
255.255.255.0) or a prefix length (24). - Select Calculate to get the network address, broadcast address, wildcard mask, usable host range, and total address count.
Related Calculations
Need to reason about the raw binary behind a mask? The Binary Calculator converts between binary, decimal, and hex. For estimating how much traffic a network needs to carry, see the Bandwidth Calculator.