VLSM Planner
Split an address block into right-sized subnets from a list of host requirements. The planner allocates the largest subnet first, accounts for the network and broadcast overhead of each subnet, reports wasted addresses, and tells you exactly how much more space you need when the block is too small.
The address block you are splitting. A host address is automatically aligned to its network boundary.
Suggestion
Subnet requirements
The VLSM algorithm
The algorithm is short, but every step matters. Getting the ordering wrong is the most common cause of a plan that fails even though the arithmetic looks like it should work.
1. For each requirement, compute the prefix:
prefix = smallest P such that 2^(32 − P) ≥ hosts + 2
2. Sort requirements by host count, descending.
3. Start the cursor at the base network address.
4. For each requirement in order:
round the cursor up to the next multiple of the subnet size
if the subnet fits inside the base block, assign it
advance the cursor past the assigned subnet
5. If any requirement could not be placed, the block is too small.Step 4's alignment is the part that manual spreadsheets get wrong. A subnet of size 64 must begin at an address that is a multiple of 64, so the cursor has to be rounded up rather than simply moved forward by the previous subnet's size.
Worked example: 10.0.0.0/24 with four departments
Requirements: Office 100, Development 50, Camera 20, Management 10.
Sized individually: 100 hosts needs 102 addresses, so a /25. 50 hosts needs 52, so a /26. 20 hosts needs 22, so a /27. 10 hosts needs 12, so a /28.
Sorted largest first: Office /25, Development /26, Camera /27, Management /28.
Cursor 10.0.0.0 → allocates 10.0.0.0/25 (128 addresses) cursor now 10.0.0.128 Cursor 10.0.0.128 → allocates 10.0.0.128/26 (64 addresses) cursor now 10.0.0.192 Cursor 10.0.0.192 → allocates 10.0.0.192/27 (32 addresses) cursor now 10.0.0.224 Cursor 10.0.0.224 → allocates 10.0.0.224/28 (16 addresses) cursor now 10.0.0.240 Remaining free: 10.0.0.240 – 10.0.0.255 (16 addresses, a /28)
The four subnets consume 240 of the 256 addresses and leave a clean /28 at the end. Note that every subnet landed on a natural boundary — .0, .128, .192, .224 — because the allocations were ordered by size.
What happens when you allocate smallest first
The same requirements against 10.0.0.0/24 in the wrong order: Management /28 at 10.0.0.0, Camera /27 at 10.0.0.32, Development /26 at 10.0.0.64. That leaves 10.0.0.128 onwards free — only 128 addresses — and the Office /25 needs 128 starting on a multiple of 128. It happens to fit here, but the margin is zero.
Now change Development to a /25 and Office to a /26. Smallest-first places the /26 at .0 and the /25 at .64, which is not a multiple of 128 — so the /25 cannot be placed at all, despite 192 addresses being free. Largest-first would have put the /25 at .0 and the /26 at .128 with no problem.
Sizing rules that hold up in production
- Add the network and broadcast. A requirement for 100 hosts needs 102 addresses, not 100. Forgetting this gives you a subnet that is one address short of the requirement.
- Count infrastructure addresses. The gateway, the switch management interface and any HSRP or VRRP virtual address all come out of the usable range before devices get theirs.
- Use /31 on point-to-point links. A /30 wastes two of its four addresses on every WAN link. Across hundreds of links that is real space.
- Size for three to five years. Re-addressing a live VLAN is disruptive. If a department is at 100 hosts and growing, a /24 today is cheaper than a /25 now and a migration in two years.
- Keep the plan in version control. The CSV export is designed to be committed alongside your configuration templates so the plan and the device configuration can be reviewed together.
Planning across multiple blocks
Real networks rarely fit in a single /24. The usual pattern is a private /16 or a /12 carved into sites, with each site then possibly sub-allocated further. Apply the planner hierarchically: first allocate /20 blocks to sites, then run the planner again inside each site allocation for its own VLANs. Because each site's block starts on a natural boundary for its size, the two levels compose without conflict.
Frequently asked questions
What is VLSM?
VLSM stands for Variable Length Subnet Mask. It means using different prefix lengths inside the same address space, so a 100-host department gets a /25 while a 2-device WAN link gets a /30. Before VLSM, every subnet in a network had to be the same size, which wasted enormous amounts of address space on links that needed only two addresses.
Why must subnets be allocated largest first?
Because each subnet must start on a boundary that is a multiple of its own size. A /25 must start on a multiple of 128 and a /26 on a multiple of 64. If you allocate the small subnets first, they scatter across the block and leave no aligned space large enough for the big ones — even when the total free space is technically sufficient. Sorting largest first is not a heuristic; it is what guarantees a fitting plan is found whenever one exists.
How do I work out the prefix length for a host requirement?
Add two to the host count for the network and broadcast address, then find the smallest power of two that is at least that total. For 100 hosts you need 102 addresses, and the smallest power of two that fits is 128, which means 7 host bits and a /25. The calculator shows the required prefix next to each row as you type, so you can see the sizing before you calculate.
What happens if my requirements do not fit the base network?
The planner reports exactly how much space is available, the total requested, and the smallest prefix that would work — for example, suggesting 10.0.0.0/23 instead of 10.0.0.0/24. It also names the specific subnets it could not place, which is usually more actionable than a generic failure message.
Does VLSM waste addresses?
Yes, unavoidably. Subnets come in power-of-two sizes, so a requirement for 20 hosts consumes a /27 with 30 usable addresses, wasting 10. Summing these rounding losses across a plan gives the total wasted figure the calculator reports. Choosing a larger base network or accepting the waste are the only two options — there is no IPv4 subnet size between 14 and 30 usable hosts.
Should I use /31 for WAN links in a VLSM plan?
On modern routers, yes. RFC 3021 lets both addresses of a /31 be assigned to the two endpoints of a point-to-point link, so a /31 wastes nothing at all while a /30 wastes two addresses. The planner accepts a requirement of 2 hosts and assigns a /31 for it.
How much growth space should I leave?
A common practice is to size each subnet one prefix larger than the current requirement — a 100-host department gets a /24 instead of a /25 — because moving a VLAN to a new subnet later means re-addressing every device. Reserve the leftover block at the end of the range for entirely new subnets. The planner shows the unused range explicitly so you can see what is left.