Network tool

IPv4 subnet calculator

Enter an IPv4 address and prefix to get the network address, mask, broadcast and usable host range.

Worked examples

IPv4 only. IPv6 prefix maths is different enough that a half-hearted version would mislead, so this tool does not pretend to do it.

Why the host count is not 2^(32-prefix)

The all-zeros network address and the all-ones broadcast address cannot be assigned to hosts in a normal subnet, so a /24 gives 256 addresses but 254 usable hosts. The exceptions are /31 (RFC 3021 point-to-point links) and /32 (single hosts), which have no broadcast address to reserve.