CIDR Subnet Calculator: Split, VLSM and Supernet

CIDR Subnet Calculator

Split a CIDR block into equal subnets, size subnets from a host count, plan a VLSM layout, and aggregate blocks into a supernet. Every subnet network, host range, and broadcast is derived with unsigned 32-bit CIDR math.

🎯Real CIDR Presets

📝CIDR Inputs

Dotted quad, e.g. 10.0.0.0 or 192.168.1.0.

Used for the split-into-new-prefix mode.

Rounded up to the next power of two.

Used for the size-by-hosts mode.

Number of subnets 0 equal blocks from base
New prefix & mask /0 subnet mask
Usable hosts / subnet 0 per new subnet
Total usable hosts 0 across all subnets

🔢CIDR Math Snapshot

/24Base prefix
2Bits borrowed
64Addresses / subnet
.64Subnet step

📋Generated Subnet List

#Network / CIDRFirst HostLast HostBroadcastUsable Hosts
Enter a base block and split settings above, then calculate the subnet list.

📐CIDR to Mask to Hosts Reference

PrefixSubnet MaskWildcardTotal AddressesUsable Hosts/24s Covered
/16255.255.0.00.0.255.25565,53665,534256
/17255.255.128.00.0.127.25532,76832,766128
/18255.255.192.00.0.63.25516,38416,38264
/19255.255.224.00.0.31.2558,1928,19032
/20255.255.240.00.0.15.2554,0964,09416
/21255.255.248.00.0.7.2552,0482,0468
/22255.255.252.00.0.3.2551,0241,0224
/23255.255.254.00.0.1.2555125102
/24255.255.255.00.0.0.2552562541
/25255.255.255.1280.0.0.1271281261/2
/26255.255.255.1920.0.0.6364621/4
/27255.255.255.2240.0.0.3132301/8
/28255.255.255.2400.0.0.1516141/16
/29255.255.255.2480.0.0.7861/32
/30255.255.255.2520.0.0.3421/64

Subnet Count vs Hosts Trade-off (from a /24)

New PrefixBits BorrowedSubnetsAddresses EachUsable Hosts EachTotal Usable
/2512128126252
/26246462248
/27383230240
/284161614224
/2953286192
/3066442128

🗂VLSM Design Example (10.0.0.0/24)

SegmentHosts NeededPrefixBlock SizeNetwork / CIDRUsable RangeBroadcast
Sales LAN100/2512810.0.0.0/25.1 - .12610.0.0.127
Engineering50/266410.0.0.128/26.129 - .19010.0.0.191
Ops team25/273210.0.0.192/27.193 - .22210.0.0.223
Servers10/281610.0.0.224/28.225 - .23810.0.0.239
Mgmt VLAN5/29810.0.0.240/29.241 - .24610.0.0.247
WAN link A2/30410.0.0.248/30.249 - .25010.0.0.251
WAN link B2/30410.0.0.252/30.253 - .25410.0.0.255

🔗Supernet / Aggregation Reference

Blocks CombinedCountAggregate CIDRMaskTotal Addresses
192.168.0.0/24 + .1.0/242192.168.0.0/23255.255.254.0512
192.168.0.0/24 ... .3.0/244192.168.0.0/22255.255.252.01,024
10.0.0.0/24 ... 10.0.7.0/24810.0.0.0/21255.255.248.02,048
172.16.0.0/16 + 17.0.0/162172.16.0.0/15255.254.0.0131,072
10.0.0.0/8 + 11.0.0.0/8210.0.0.0/7254.0.0.033,554,432
192.168.1.0/24 + .2.0/242192.168.0.0/22255.255.252.01,024

Full Formula Breakdown

IP to integeripInt = ((a<<24) | (b<<16) | (c<<8) | d) >>>0. Each octet occupies 8 bits of an unsigned 32-bit value.
Prefix to maskmask = prefix == 0 ? 0 : (0xFFFFFFFF << (32 - prefix)) >>>0. Network = (ipInt & mask) >>>0.
Subnet countSplitting a /b into /P (P > b) yields 2^(P - b) equal subnets; those P - b bits are borrowed from the host field.
Subnet sizeAddresses per subnet = 2^(32 - P). Subnet i network = (baseNetwork + i × size) >>>0.
By countnewPrefix = basePrefix + ceil(log2(N)). Rounding up to a power of two keeps every subnet the same size.
By hostsNeed H usable hosts: smallest P with 2^(32 - P) - 2 ≥ H. Host bits = ceil(log2(H + 2)); P = 32 - host bits.
Broadcast & rangeBroadcast = (network | ~mask) >>>0. First host = network + 1, last host = broadcast - 1 for P ≤ 30.
SupernetFind the longest prefix where both blocks share the same network: aggregate = common leading bits of the two addresses.

💡Practical CIDR Tips

Borrowing bits: Every bit you take from the host field doubles the subnet count and halves the addresses per subnet, so a /24 into /26 gives four subnets of 64 addresses each.
VLSM order: Assign the largest subnet first and work down. Placing big blocks before small ones keeps every subnet boundary aligned and avoids overlaps or wasted gaps.

Do you recall your initial experience subnetting a /24 on that white board for your certification exam? You wrote out powers of two, subtracted the broadcast and network addresses, prayed that you hadn’t miscalculated by a single bit, and then did it all over again for ten subnets. It was mind-numbing, error-prone, and downright soul crushing.

And that’s precisely why we have tools. But in order to use those tools well, we should understands their logic, not blindly trust what they tell us to do. That’s where the calculator comes into play; after defining the base block as well as parameters for splitting it up, the hard work is done for you; no more converting between binary by hand!

The Logic Behind Subnetting

Now there’s just one question: how do you determine these parameters in first place? This is where the core trade-off for any subnet lies: how many subnets are needed versus how many host per subnet? If you want to double the former, you must halve the latter, because every bit removed from the host portion of an address results in doubling your amount of subnets but halving their respective sizes. It’s a zero-sum game with a fixed prefix length.

If you divide up a typical /24 into four equally sized subnets then what have you done? You’ve borrowed two bits out of the host part of the address space. How many subnets do two bits get you? 2 to the power of 2, or 4 subnet. What does that cost you? Each one of your subnets has been reduced from 256 possible addresses down to 64 addresses. A little home/office network may well be just right. That simply won’t cut it for a publicly accessible server farm.

Bottom line: match the prefix length with the real-world requirements of the segment itself. A /30 is really only good for two useable hosts; perfect if you need a point-to-point link and there’ll never be anything else on there. Wasting 252 addresses that way on a local link is no big deal. However, try that at scale with thousands of routers, where each has dozens, hundreds, or even more interface, and it’s a nightmare.

The waste problem is solved by Variable Length Subnet Masking (VLSM), which allows for multiple prefix lengths in the same address space. Rather than slicing the block into equal pieces, you make cuts as if assembling a puzzle. First, give the biggest subnet you need. Then, the next-biggest. And the next. This continues all the way down to your point-to-point link. Every bit has something to do; no more wasting bits, which keeps the addressing efficient.

With this approach, the calculator let you plan subnets precisely to the number of hosts needed. It will find the smallest prefix that’s sufficient and doesn’t spill over into neighboring blocks. For example, supernetting combines small prefix sums into larger summary routes that shrink the size of routing tables. Because internet edge routers can be carrying millions of routes, this is important in designing networks.

For example, instead of 10 /24 routes you could combine two side-by-side ones into a /22 or /23. This makes the topology simpler and uses less memory on your network device. But the aggregation doesn’t work unless the blocks line up nicely with each other based off their bits. You can’t take a 192.168.1.0/24 and 192.168.3.0/24 and aggregate them together into one /23. They’re not contiguous. The table on the page shows which ranges the masks cover, making it clear how the blocks need to line up for aggregation to work.

The mistake here isn’t usually an error in calculating the math; it’s either overestimating how fast your network will grow or underestimating overhead. In traditional IPv4 networks, network and broadcast addresses reduces your usable capacity by two per subnet. That leaves only 126 addresses out of 126. You need to plan on having enough for exactly 100 hosts (even if they don’t match perfectly), which means using a /25 subnet.

Netmasking (subnetting) boils down to a matter of balance. There aren’t an infinite number of addresses; you’re taking finite resources and distributing them across various demands while still leaving each segment sufficient space to breathe without using more addresses than necessary. While the tool does the dividing for you, you supply the strategy.

Next time you’re reviewing your network diagram, consider: do all those prefix lengths accurately represent the traffic carried by each one? Or have they been applied simply out of habit? Efficiency matters, yes (but so does maintainability). An orderly address map helps troubleshooting when things invariably go wrong. So take your biggest chunks first, then work your way downward to the tiniest bits, and trust the calculator to make sure all those edges line up.

You’re no longer solving a hard math problem; you’ve turned it into an easy design decision where you can concentrate on architectural concerns instead of numbers. Whether you have a few VLANs or need to manage an entire cloud infrastructure, this results in a network that scales easy.

CIDR Subnet Calculator: Split, VLSM and Supernet