CIDR Range Calculator
A prefix in, its boundaries out — first address, last address, how many there are, and what it sits inside.
Local toolYour network plan stays in your browser. Nothing you enter is uploaded, logged, or sent to any server.
Notes
Total addresses counts every address in the prefix. Usable hosts subtracts the network and broadcast addresses for IPv4 — except at /31 and /32, where RFC 3021 and host routing mean all addresses are usable. IPv6 has no broadcast address, so the two figures are always equal.
The containment check answers the question that actually causes arguments: whether one prefix sits inside another. It distinguishes contained from overlapping, because a partial overlap is a different problem and usually a mistake.
Reading a prefix length
Every bit of prefix halves the block. A /24 holds 256 addresses, a /25 holds 128, a /26 holds 64, and so on down to /32, which is a single address. Going the other way, each bit you remove doubles it. That is the whole of the arithmetic, and it is why prefix lengths that look adjacent on paper — a /23 and a /24 — differ by a factor of two in what they cover.
The count of usable hosts is a separate question from the count of addresses. In IPv4 the first address of a block is the network address and the last is the broadcast address, so a /24 offers 254 hosts rather than 256. Two prefix lengths break that rule deliberately. A /31 has no room for either, and RFC 3021 defines it as a two-address point-to-point link where both are usable; it exists so that router-to-router links stop wasting half a /30. A /32 is a host route — one address, and it is usable. IPv6 has no broadcast address at all, so its two counts are always identical.
Contained is not the same as overlapping
This is the distinction that causes the arguments. If one prefix sits entirely inside another, that is normally intentional: a more specific route, a carved-out subnet, an exception in a filter. If two prefixes partially overlap — sharing some addresses but neither containing the other — that is almost always a mistake, because CIDR blocks are aligned to powers of two and two correctly written prefixes cannot partially overlap by accident.
When you see a partial overlap, the usual cause is a range that was written down as a start and an end address and then converted to a prefix by eye. The arithmetic does not forgive that, which is what the IP Range to CIDR tool is for.
Related tools
Subnet Calculator shows the mask and the bits. IP Range to CIDR goes the other way, from two addresses to prefixes.