Subnet Calculator

Split an IPv4 address and prefix into network, broadcast, mask and usable host range — instantly, in your browser.

How it works

A subnet mask splits a 32-bit IPv4 address into a network part and a host part. With prefix length n, the first n bits are the network; the rest identify hosts. AND-ing the address with the mask gives the network address; OR-ing with the inverted mask gives the broadcast address. The first and last addresses of the range are reserved (network and broadcast), except for /31 point-to-point links and /32 single-host routes. Everything is computed locally with integer bit operations — no data leaves your device.

Frequently asked questions

How many usable hosts does a /24 have?

254. A /24 leaves 8 host bits: 28 = 256 addresses, minus network and broadcast.

What is the difference between /24 and 255.255.255.0?

None — they are two notations for the same mask. /24 means the first 24 bits are ones, which written as four octets is 255.255.255.0.

Does this support IPv6?

Not yet — this calculator handles IPv4 only. IPv6 subnetting follows the same idea with 128-bit addresses, usually split at /64.