IP Subnet Calculator
Calculate subnet mask, host range, broadcast address, and available hosts from CIDR notation.
Decode any IPv4 address with CIDR notation into its network address, subnet mask, broadcast address, and usable host range — a core task for network setup and troubleshooting.
How IP Subnet Calculator Works
The calculator converts the four IP address octets and the CIDR prefix (the number after the slash) into 32-bit binary numbers. It builds the subnet mask by setting the first "prefix" number of bits to 1 and the rest to 0, then applies that mask to the IP address to find the network address (the first address in the subnet).
The broadcast address — the last address in the subnet, reserved for sending to every device on it — is found by taking the network address and setting every bit outside the mask to 1. The usable host range is everything between the network and broadcast addresses, excluding both, since those two addresses can't be assigned to individual devices.
Total usable hosts is calculated as 2 raised to the number of remaining (host) bits, minus 2 for the network and broadcast addresses — except for /31 and /32 prefixes, which are special cases with no separate broadcast address.
See It In Action
Who Uses IP Subnet Calculator and Why
- Working out how many usable host addresses a given /24 or /28 network actually provides before assigning IP addresses to office equipment.
- Planning how to split a larger allocated block into smaller subnets for different departments or VLANs without overlapping ranges.
- Double-checking a router or firewall's subnet mask configuration matches what a network diagram or ISP documentation specifies.
- Studying for a networking certification exam where converting between CIDR notation and dotted-decimal subnet masks comes up repeatedly.
Mistakes to Avoid
- Assuming the number of usable hosts equals 2 raised to the host-bit count — it's always two less than that, since the first address in the range identifies the network itself and the last is reserved as the broadcast address.
- Confusing the CIDR prefix length with a host count directly — a /24 doesn't mean 24 hosts, it means 24 bits are reserved for the network, leaving 8 bits (254 usable hosts) for hosts.
- Entering an IP address without the /prefix suffix and expecting a subnet calculation — the CIDR notation is what defines the subnet boundary, so the address alone isn't enough information.
Tips for Best Results
- If you're planning subnets ahead of time, start from the largest block you've been allocated and work out how a /25, /26, or /27 split would divide it before committing to a scheme.
- Remember that a /32 refers to a single address, not a range — useful when you need to route or filter traffic to one exact device rather than a whole subnet.
Fixing Common Problems
The broadcast address the calculator shows doesn't match what I expected. — Recheck the CIDR prefix you entered — a common error is off-by-one prefix lengths (e.g., entering /25 when you meant /24), which shifts the entire range including the broadcast address.
I need to know how many subnets I can carve out of a larger block, not just the range of one subnet. — Calculate the target subnet's prefix length, then divide the size of your larger block by the size of each smaller subnet — this tool calculates one CIDR block at a time rather than a full subnetting plan.
Terms Explained
CIDR (Classless Inter-Domain Routing): A notation that specifies an IP address alongside a prefix length (like /24), indicating how many bits of the address are reserved for the network portion.
Broadcast address: The last address in a subnet's range, reserved for sending a message to every device on that subnet at once — never assignable to an individual device.
Host bits: The bits of an IPv4 address not reserved for the network portion, which determine how many individual device addresses the subnet can hold.