Skip to content

IPv4 · IPv6 · runs in your browser

The IP CIDR calculator that shows you the whole tree.

Split any CIDR block into a tree of subnets, copy any block in one click, and read exact network, broadcast, subnet mask, wildcard and host numbers for IPv4 and IPv6.

Try

Built for planning, not just checking.

A tree, not a flat list

Split one branch to /26 and leave its sibling at /17. The hierarchy stays visible, so you can see which space is committed and which is still whole.

Everything copies

Each block, each mask, each host boundary has its own copy button. Or grab every leaf in the tree as one newline-separated list, ready to paste into Terraform or a firewall rule.

Nothing leaves the tab

The whole calculator is client-side JavaScript over BigInt arithmetic. No account, no request to a server, no record of the prefixes you plan.

How the split tree works

A CIDR prefix is just a boundary. 10.0.0.0/16 says the first 16 bits identify the network and the remaining 16 belong to hosts — 65,536 addresses in one block.

Move that boundary one bit right and you have two blocks of 32,768. Move it again and you have four of 16,384. That is all subnetting is, and it is why every level of the tree below has exactly two children.

The reason a tree beats a flat list is that real allocations are uneven. A site might need one /20 for servers, a couple of /24s for management VLANs, and a large untouched reservation for growth. Split the branches you need and leave the rest whole — the tree records that decision, and the allocation map shows how much space each choice consumed.

Splitting 10.0.0.0/22

10.0.0.0/22          1,024 addresses
├── 10.0.0.0/23        512
│   ├── 10.0.0.0/24      256   ← servers
│   └── 10.0.1.0/24      256   ← management
└── 10.0.2.0/23        512     ← reserved

Two splits on the left branch, none on the right. The /23 on the right stays a single allocatable block instead of being carved up before anyone needs it.

What an IP CIDR calculator does

An IP CIDR calculator takes a block written in prefix notation — 10.0.0.0/16, 192.168.1.0/24, 2001:db8::/48 — and works out everything that follows from it: the network address, the broadcast address, the subnet mask, the wildcard mask, the first and last usable host, and the exact number of addresses the block contains. CIDR, short for Classless Inter-Domain Routing and defined in RFC 4632, replaced the old class A/B/C system in 1993. Since then the number after the slash has been the only thing that decides how large a block is. People look for the same tool under half a dozen names — CIDR calculator, IP address CIDR calculator, subnet CIDR calculator — and the job behind all of them is identical: turn a prefix into numbers you can act on, in IPv4 and IPv6 alike.

This CIDR calculator does that arithmetic and then does the part most tools skip: it lets you split the block. Press Split on any row and it halves into two children. Press Split on one of those children and only that half divides further. What you end up with is a tree that records the shape of a real allocation, rather than a flat list of equal-sized subnets you have to reassemble in your head.

How to use this CIDR calculator

  1. Type or paste a CIDR block into the field at the top of the page. It starts on 10.0.0.0/16, and the example chips swap in a private range, a CGNAT range or an IPv6 prefix.
  2. Read the block details underneath — subnet mask, wildcard mask, usable host range, total addresses, and around twenty further fields under All properties.
  3. Split the tree. Split evenly takes every current block one prefix bit deeper; splitting individual rows gives you the uneven, VLSM-style layout that real networks actually have.
  4. Copy what you need. Every block, mask and address has its own copy button, and Copy all hands you every leaf of the tree as a newline-separated list — the format a Terraform variable or a firewall object group wants.

The input is deliberately forgiving. It accepts standard CIDR notation, a bare IP address (treated as a /32 or /128), a dotted subnet mask such as 192.168.1.0/255.255.255.0, and a wildcard mask such as 10.0.0.0/0.0.255.255. The last two are why the tool doubles as a subnet mask to CIDR calculator: those inputs resolve to 192.168.1.0/24 and 10.0.0.0/16. A bare address with no slash at all is read as a /32 or /128, which is how it works as an IP address to CIDR calculator when you need a single host expressed as a block. If you enter an address that still has host bits set — 10.0.4.9/22 — it is normalised to its network address, 10.0.4.0/22, and a note below the field tells you it happened. That is exactly what routing hardware does with the same input.

Every field the calculator returns

For an IPv4 CIDR range you get CIDR notation, prefix length, address family, network address, broadcast address, first and last usable host, subnet mask, wildcard mask, total addresses, usable hosts, address type (private, CGNAT, loopback, link-local, documentation, multicast or public), the legacy class, how many /24 blocks fit inside, the network as a decimal integer and as hexadecimal, the network and mask in binary, and the in-addr.arpa reverse DNS name.

For an IPv6 prefix the same panel shows the first and last address in RFC 5952 form, both again fully expanded, the total address count, the address type, how many /64 subnets the prefix contains, decimal and hexadecimal forms, and the ip6.arpa name. Every one of those values copies with a single click.

CIDR blocks, CIDR ranges and prefix length

A CIDR block is a run of addresses whose leading bits are all identical. The prefix length counts those fixed bits, so the block holds 232 − prefix addresses in IPv4. A /16 holds 65,536 addresses, a /22 holds 1,024, a /24 holds 256, and a /30 holds 4. IPv4 reserves the first address of a subnet as the network address and the last as the broadcast address, which is why a /24 offers 254 usable hosts and a /30 offers 2. The exception is a /31, where RFC 3021 allows both addresses to be used on a point-to-point link.

Every CIDR block is also a contiguous CIDR range: 10.0.4.0/22 is precisely 10.0.4.0 through 10.0.7.255. The reverse does not hold, because a block must begin on an address aligned to its own size. That asymmetry is why the IP range to CIDR calculator usually answers with several blocks for one arbitrary range, while the CIDR to IP range calculator always answers with exactly one start and end address.

Subnet mask to CIDR, and back again

A prefix length and a subnet mask are the same number written two ways. Count the one-bits in the mask and you have the prefix: 255.255.255.0 is three full octets of ones, so 8 + 8 + 8 = /24. Only nine values can appear in a valid mask octet — 0, 128, 192, 224, 240, 248, 252, 254 and 255 — contributing 0 through 8 bits. That makes 255.255.240.0 equal to 8 + 8 + 4 = /20, whose wildcard mask, the bitwise inverse that Cisco ACLs and OSPF network statements expect, is 0.0.15.255. Paste any of the three forms into the calculator above and it converts between them, or use the subnet mask to CIDR cheat sheet for the whole table from /0 to /32 in one page.

Subnetting with the CIDR splitter

Subnetting is the act of moving the prefix boundary one bit to the right. Each bit you borrow from the host portion doubles the number of subnets and halves their size, which is why the tree in this subnetting CIDR calculator is binary all the way down: a /16 becomes two /17s, four /18s, and so on to /32.

Real address plans are not uniform, though. A site handed a /16 might need one /20 for servers, a handful of /24s for management VLANs, a few /30s for point-to-point links, and a large untouched reservation for whatever comes next. Variable-length subnet masking (VLSM) is how you get there, and a CIDR splitter shaped like a tree is how you keep track: split only the branches you have committed, leave the rest whole, and the allocation map above the tree shows at a glance how much of the parent block each decision consumed. Used that way it is a subnet calculator and a planning document at the same time — the tree is the plan. The subnetting guide walks through a full plan from requirements to finished allocation.

IPv6: the same arithmetic, much wider

The calculator is BigInt-based throughout, so IPv4 and IPv6 run through one code path and an IPv6 prefix behaves exactly like an IPv4 one. The numbers are simply larger: a /48, the block typically delegated to a single site, contains 65,536 /64 subnets — 1,208,925,819,614,629,174,706,176 addresses — and a single /64 holds 18,446,744,073,709,551,616. IPv6 has no broadcast address and reserves no network address, so the usable count always equals the total, and /64 is the standard subnet size because stateless autoconfiguration (SLAAC) needs the lower 64 bits for the interface identifier. Addresses are printed in RFC 5952 canonical form, with the expanded eight-group form alongside for configuration files that insist on it. The dedicated IPv6 CIDR calculator has the same tree plus a table of the prefix sizes worth memorising.

Nothing you type leaves the browser

Every calculation on this site runs as client-side JavaScript. There is no API call, no account, no analytics and no log of what you enter, which matters when the block you are planning is internal infrastructure that has not been announced yet. The cheat sheet and the private address range reference are rendered at build time and work with JavaScript disabled entirely.

Questions people actually ask

What does splitting a CIDR block actually do?

It borrows bits from the host portion of the address and gives them to the network portion. Every bit you borrow doubles the number of subnets and halves the size of each one, so a /24 becomes two /25s, four /26s, and so on. The tree here shows that halving directly — each row is one prefix bit deeper than its parent.

Why does a /24 have 254 usable hosts instead of 256?

A /24 contains 256 addresses, but IPv4 reserves the first as the network address and the last as the broadcast address, leaving 254 for hosts. The exceptions are /31, which RFC 3021 allows to use both addresses on a point-to-point link, and /32, which is a single host route.

Can I split unevenly, into different sized subnets?

Yes — that is variable-length subnet masking (VLSM), and it is what the tree is for. Split only the branches you need. Halve a /16 once, then keep splitting just the left half down to /24s while the right half stays a single /17. The allocation map above the tree shows the resulting uneven layout at a glance.

Is this an IPv6 CIDR calculator too?

It is. Paste any IPv6 prefix and the same tree, copy buttons, and property table apply. Addresses are formatted per RFC 5952, and counts beyond a few quintillion switch to scientific notation because a /48 holds 1.2 × 10^24 addresses. There is a dedicated IPv6 page if you work in 128-bit space most of the time.

Are the addresses I type sent anywhere?

No. All parsing and arithmetic happens in JavaScript in your browser. There is no API call, no analytics, and no logging of what you enter — which matters when the prefix you are planning is internal infrastructure.

What input formats are accepted?

Standard CIDR (10.0.0.0/16), a bare address which is treated as a /32 or /128, a dotted netmask (192.168.1.0/255.255.255.0), and a wildcard mask (10.0.0.0/0.0.255.255). If you include host bits, the block is normalised to its network address and the change is noted below the input.

Common CIDR questions

What is CIDR calculation?

CIDR calculation is the arithmetic that turns a prefix such as 10.0.0.0/16 into everything that follows from it: the network address, the broadcast address, the subnet mask, the wildcard mask, the first and last usable host, and the total number of addresses in the block. A CIDR calculator does all of it in one step from a single input, and this one also splits the block into smaller subnets so you can plan an allocation rather than only check one number.

What does CIDR stand for?

CIDR stands for Classless Inter-Domain Routing, and it is normally pronounced "cider". It was introduced in 1993 by RFC 1519, since superseded by RFC 4632, and it replaced the fixed class A, B and C address blocks with an arbitrary prefix length written after a slash. The "classless" part is the point: the boundary between network and host can now sit at any bit position rather than only at octet 8, 16 or 24.

How many IPs are in a /20 CIDR block?

A /20 contains 4,096 IP addresses. Twenty of the 32 bits are fixed by the prefix, leaving 12 host bits, so the block holds 2^12 = 4,096 addresses — 4,094 of them usable once the network and broadcast addresses are set aside. A /20 is the same span as 16 consecutive /24 blocks, and its subnet mask is 255.255.240.0.

How do I find my CIDR?

Take the IP address and subnet mask your device already has, then convert the mask to a prefix length. On Linux, "ip addr show" prints it in CIDR form directly, as in inet 192.168.1.42/24. On macOS, "ifconfig en0" reports the mask in hexadecimal, where 0xffffff00 is /24. On Windows, "ipconfig" shows Subnet Mask 255.255.255.0, which is also /24. For a cloud network the block is listed on the VPC or virtual network page. Paste the address and mask into the calculator above and it returns the block.

What is CIDR and why is it used?

CIDR is both the notation for an address block and the allocation scheme that replaced classful addressing. It is used for two reasons. Blocks can be sized to fit, so an organisation needing 2,000 addresses receives a /21 with 2,046 usable hosts instead of an entire class B, which slowed IPv4 exhaustion considerably. And adjacent blocks aggregate into one route, so a router can advertise 10.0.0.0/16 rather than 256 separate /24 entries, which is what keeps the global routing table a manageable size.

What is 255.255.0.0 in CIDR?

255.255.0.0 is /16. The mask contains 16 one-bits — two full octets of 255 followed by two empty ones — and the prefix length is simply that count. A /16 block holds 65,536 addresses, 65,534 of them usable, and its wildcard mask, the inverse form that Cisco ACLs expect, is 0.0.255.255.

What is a /24 CIDR range?

A /24 is a run of 256 consecutive addresses whose first 24 bits are fixed, so 192.168.1.0/24 covers 192.168.1.0 through 192.168.1.255. Its subnet mask is 255.255.255.0 and 254 addresses are assignable, because the first is the network address and the last is the broadcast address. It is the most common subnet size on local networks, which is why a /24 maps neatly onto one office VLAN.

How do I convert an IP address to CIDR format?

A single address in CIDR notation is a /32, so 192.168.1.42/32 means that one address and nothing else. If you have an address and a subnet mask, count the one-bits in the mask to get the prefix and clear the host bits: 192.168.1.42 with 255.255.255.0 becomes 192.168.1.0/24. Both forms work in the calculator above. To turn an arbitrary start and end address into blocks instead, use the IP range to CIDR converter.

How many IP addresses are in a /16 CIDR block?

A /16 contains 65,536 IP addresses, because 16 of the 32 bits are left free for hosts and 2^16 = 65,536. Of those, 65,534 are usable hosts. That is the same size as a legacy class B network and equal to 256 /24 blocks, which is one reason /16 is the default block size offered for a lot of cloud VPCs.

Is CIDR still used?

Yes. It is the only way IP addresses are allocated and routed today. Classful addressing has been obsolete since 1993, every BGP route on the internet is a CIDR prefix, and every cloud provider asks for a CIDR block when you create a VPC, a subnet or a security-group rule. IPv6 uses exactly the same notation, with prefix lengths running from /0 to /128.

More calculators