Network · Developer
Subnet calculator.
Enter an IPv4 address and a CIDR prefix to get the network address, broadcast address, subnet mask, wildcard mask, and usable host range — including the /31 point-to-point and /32 single-host special cases.
Inputs
Result
Enter an address and prefix, then press Calculate.
How it's calculated
The CIDR prefix sets how many leading bits of the 32-bit address are the network portion. The subnet mask is that many 1-bits followed by 0-bits; the network address is the IP with the host bits zeroed out; the broadcast address is the IP with the host bits all set to 1. For most prefixes (/0–/30), the network and broadcast addresses are reserved, so usable hosts = total addresses − 2.
Two prefixes are special. A /31 subnet (2 addresses) has no reserved network or broadcast address at all — RFC 3021 states plainly that "the two addresses... MUST be interpreted as host addresses," making both usable, typically for a point-to-point link. A /32 is a single host route: one address, one usable host.
Specs: RFC 4632 (classless inter-domain routing) and RFC 3021 (the /31 point-to-point exception).
Frequently asked questions
What's the difference between the subnet mask and the wildcard mask?
The subnet mask marks network bits with 1 and host bits with 0. The wildcard mask (used in access-control lists on some routers/firewalls) is its exact bitwise complement: host bits are 1, network bits are 0.
Why does a /31 only show 2 total addresses but also 2 usable hosts?
Because RFC 3021 removes the usual network/broadcast reservation for exactly this prefix length — both of its 2 addresses are valid host addresses, which only matters for point-to-point links where you'd otherwise waste half your addresses on reservations.
Does this work for IPv6?
No, this tool is IPv4 only. IPv6 subnetting uses 128-bit addresses and different conventions.
Pure arithmetic — no network access
This tool performs standard IPv4 subnet arithmetic entirely in your browser. It doesn't check whether the address or subnet is actually routed, reachable, or assigned to anyone.