IPv4 subnet calculator

Enter an IP with a prefix like 192.168.1.10/24 to get the network, broadcast, mask and usable host range.

How subnetting works

The prefix length says how many leading bits identify the network. AND-ing the address with the mask gives the network address; setting all host bits to 1 gives the broadcast address. Usable hosts = 232 − prefix − 2, except /31 (point-to-point links, RFC 3021) and /32 (a single host).

Worked example: 192.168.1.10/24

Mask 255.255.255.0 → network 192.168.1.0, broadcast 192.168.1.255, hosts .1 to .254 = 254 usable.

Private address ranges (RFC 1918)

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

See every prefix in the CIDR table.

Frequently asked questions

How many hosts are in a /24?
256 addresses, 254 usable hosts.
Why subtract 2?
The first address identifies the network and the last is the broadcast address, so neither can be assigned to a host (except in /31 and /32).