Calculate a subnet

IPv4 or IPv6 in CIDR notation. Without a prefix, a single address (/32 or /128) is assumed.

Examples:

Enter a network to see its range, masks and host counts.

How it works

Pure arithmetic on the address bits, done entirely in your browser — nothing is sent to a server. The prefix length sets how many leading bits identify the network; the remaining bits number the hosts.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses, minus the network and broadcast addresses.

What about /31 and /32?

A /31 has two usable addresses on point-to-point links (RFC 3021); a /32 is a single host.