Subnet Calculator & Visualizer
Enter an address and a prefix length. See the network, the broadcast, the usable range, and exactly which bits the mask is holding.
Local toolYour network plan stays in your browser. Nothing you enter is uploaded, logged, or sent to any server.
Where the mask falls
Highlighted network bits Dimmed host bits
How the numbers are worked out
A prefix length says how many leading bits identify the network. The rest identify a host inside it. Everything else follows: the network address is the address with all host bits set to zero, the broadcast is the same with all host bits set to one, and the size of the subnet is two raised to the number of host bits.
Usable hosts are not always size minus two. That rule assumes a network address and a broadcast address which cannot be assigned. It holds from /0 to /30. It does not hold at /31, which RFC 3021 defines as a point-to-point link with two usable addresses and no broadcast, and it does not hold at /32, which is a single host route. Calculators that report zero usable addresses for a /31 disagree with the routers people actually configure.
IPv6 has no broadcast address at all, so every address in an IPv6 prefix is usable. Subtracting two there is simply an IPv4 habit applied where it does not belong.
A subnet mask must be a contiguous run of ones followed by zeros. Something like 255.255.0.255 is not a mask, and it is refused rather than quietly interpreted.
Ranges that do not behave like the rest
Some IPv4 space is reserved, and the calculator will happily do the arithmetic on it without warning you that the addresses are not ordinary. Worth recognising on sight:
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private — usable internally, never routed on the public internet. 127.0.0.0/8 is loopback, and the whole /8 belongs to it rather than just the one familiar address. 169.254.0.0/16 is link-local: a host that has given up waiting for DHCP assigns itself one of these, so seeing it usually means addressing has failed rather than succeeded.
The one that catches people is 100.64.0.0/10. It looks like ordinary public space, it is not private in the familiar sense, and it is reserved by RFC 6598 for carrier-grade NAT — addresses an ISP uses between its own equipment and its customers. If it turns up unexpectedly in a plan or a traceroute, that is what it is, and using it as though it were yours to allocate will collide with the carrier eventually.
There are no classes any more
The habit of calling a /24 "a class C" has outlived the thing it described by three decades. Classful addressing fixed the network boundary by the leading bits of the address, so 192.0.2.0 was necessarily a /24 and 10.0.0.0 was necessarily a /8. CIDR replaced it in 1993 precisely so the boundary could sit anywhere.
The vocabulary survives because the old class A, B and C sizes happen to line up with /8, /16 and /24, which are still convenient numbers. It misleads when someone assumes a size from an address rather than reading the prefix — which is how a /25 gets treated as a /24 and half a subnet quietly goes missing. The prefix length is the only thing that says how big a block is.
Related tools
VLSM Designer divides a network by host requirement. CIDR Range Calculator works the other way, from a prefix to its boundaries. IPv6 Visualizer handles compression and expansion.