Subnetting is bit arithmetic wearing a decimal disguise
An IPv4 address looks like four numbers because that is how it is written down, but every operation you perform on it happens on the underlying 32 bits. The network address is the address with all host bits cleared. The broadcast address is the same address with all host bits set. The usable range is everything strictly between them. The wildcard mask is the netmask flipped.
All of that is trivial in binary and awkward in dotted decimal, which is why people reach for a calculator rather than doing it in their head. Getting it wrong produces a route or a firewall rule that looks reasonable and matches the wrong set of hosts, which is the kind of mistake that takes a long afternoon to find.
Calculating a subnet
- Paste an address with either a CIDR prefix or a dotted netmask into the input box.
- Run it. The report opens by echoing back the interpretation it settled on.
- Read the netmask, network, and usable host sections.
- Consult the reference table at the bottom if you are sizing a subnet rather than describing one.
The edge cases most calculators get wrong
Two prefixes break the simple formula, and both are common enough that getting them wrong matters.
A /31 has exactly two addresses. Subtracting a network address and a broadcast address from two leaves zero usable hosts, which would make a /31 useless, and yet /31 links are standard practice on point to point circuits because a dedicated standard says both addresses are usable there and no network or broadcast address exists. This calculator reports two usable and marks the other two lines as not applicable.
A /32 has one address and describes a single host, which is how a loopback or a host route is expressed. Same treatment: one usable, no network, no broadcast.
There is a third trap that is invisible rather than merely unusual. In JavaScript, shifting a value left by 32 places wraps around to shifting by zero, so the obvious way to build the mask for a /0 produces a mask of all ones instead of all zeros. That case is handled explicitly, which is why /0 correctly reports a mask of 0.0.0.0 and just under 4.3 billion usable addresses rather than a single host.
Reading the report
The output is one plain text block in labelled sections. The input section confirms what was parsed. The netmask section gives the prefix, the dotted mask and the wildcard. The network section gives the network and broadcast addresses. The host section gives the first and last usable address, the usable count and the total count.
Printing the usable count and the total count separately is deliberate. Nearly every argument about subnet sizes comes down to somebody quoting one and somebody else assuming the other, and a /24 being 256 addresses but 254 hosts is exactly the sort of off by two that survives a whiteboard session and fails in production.
The echo of the parsed input at the top earns its place for the same reason. A dotted netmask and a prefix are two ways of saying the same thing, and seeing 255.255.240.0 restated as /20 is often the moment somebody realises they meant /24 and typed one octet wrong. Confirming the interpretation before the arithmetic costs one line and catches the mistake that the arithmetic itself would faithfully carry all the way through.
Neighbouring network tools
For the permissions half of server work rather than the addressing half, chmod Calculator converts between symbolic and octal modes. To identify the vendor behind a hardware address, MAC Address Lookup resolves the prefix.
When you are sizing a link rather than a subnet, Bandwidth Converter moves between bits and bytes per second, and Download Time Calculator turns that into a wait. For the records that make a domain usable once the addressing is settled, Email DNS Generator writes the entries. Everything else is on the dev tools hub.

