What the prefix length actually determines#
The number after the slash in CIDR notation — the /24 in 192.168.1.10/24 — is the number of leading bits reserved for the network portion of the address, out of the 32 total bits in an IPv4 address. The remaining bits identify a specific host within that network. A smaller prefix (like /8) reserves fewer bits for the network and leaves more for hosts, producing a much larger subnet; a larger prefix (like /30) reserves more bits for the network and leaves very few for hosts, producing a tiny subnet. This single number determines every other value this tool calculates.
Why the usable host count is normally two less than the total#
A subnet's total address count is always a power of two, but the very first address is reserved as the network address (identifying the subnet itself) and the very last is reserved as the broadcast address (reaching every host on it) — neither is assignable to an actual device. A /24 subnet has 256 total addresses but only 254 usable ones for that reason. This "subtract 2" rule is the default, but it is not universal — the two smallest possible prefixes have their own special cases.
The two edge cases most subnet calculators get wrong#
A /32 identifies exactly one address, with no room for a separate network or broadcast address — the single address is both, and is itself the only "usable" host. A /31 is defined by RFC 3021 specifically for point-to-point links (like a connection between two routers): rather than wasting half the tiny 2-address subnet on network/broadcast overhead, both addresses are usable hosts. This tool implements both cases explicitly instead of applying the generic "total minus 2" formula, which would incorrectly report 0 usable hosts for both.