IP Subnet Calculator

Calculate network address, broadcast address, usable host range, and subnet mask from an IPv4 address and CIDR prefix.

What the CIDR prefix does

A /30 prefix means the first 30 bits of the 32-bit IPv4 address identify the network, leaving 2 bits (4 addresses) for hosts. The subnet mask marks those network bits as 1s. Applying the mask to your IP address with a bitwise AND gives the network address; flipping the mask and ORing it in gives the broadcast address.

Why usable hosts is 2 less than total

The first address in a subnet is reserved as the network address and the last is reserved as the broadcast address, so neither can be assigned to a device. /31 and /32 are special cases used for point-to-point links and single-host routes, where this reservation doesn't apply the same way.

"Private" IP ranges (like 192.168.x.x, 10.x.x.x, and 172.16–31.x.x) are reserved for use within local networks and aren't routable on the public internet.

Common questions

What's the difference between a subnet mask and CIDR notation?

They're two ways of expressing the same thing — 255.255.255.0 and /24 both mean the first 24 bits are the network portion. CIDR notation is just more compact.

Does this support IPv6?

Not currently — this calculator covers IPv4 addressing and subnetting only.

More Everyday Calculators

Pick another tool to jump straight to it.