Skip to content

CIDR calculator: turn prefix lengths into allocation plans

A CIDR prefix tells you how many leading bits identify a network. Compare a source prefix with a target prefix to size an allocation before splitting it. Use the IPv4 tree for individual blocks or the IPv6 calculator for exact large counts.

Planner mode

Switch between IPv4 and IPv6 planners

Explore classic IPv4 splits or inspect IPv6 allocations without leaving the page.

Each planner keeps its own inputs so you can compare results back to back.

IPv4 Planner

Prepare your IPv4 split

Preview

Subnet breakdown

MaskHostsActions
Click "Generate subnets" to start a calculation.

Calculate blocks from a prefix difference

For an address width W, a /p network contains 2^(W − p) addresses. W is 32 for IPv4 and 128 for IPv6. Dividing a /p into equal /t blocks yields 2^(t − p) subnets when t is greater than or equal to p. A smaller target prefix would describe a larger block rather than a split.

For example, 192.0.2.0/24 divided into /27 blocks produces 2^(27 − 24) = 8 subnets, each with 32 addresses. The prefixes consume three additional network bits. The total address space is unchanged: 8 × 32 = 256.

Addresses and usable hosts are different counts

A conventional IPv4 /27 LAN has 30 usable host addresses after excluding its network and broadcast addresses. IPv4 /31 point-to-point links can use both addresses under RFC 3021; a /32 represents one address. IPv6 has no broadcast address, so IPv4’s subtract-two rule does not apply.

The IPv4 planner limits materialized results to 4,096 leaves and four tree levels. IPv6 counts remain exact even for much larger theoretical allocations, such as 65,536 /48 blocks inside a /32. It summarizes those blocks without trying to render them all.