RunTheTests
/

VLSM Subnet Planner

Fit a list of subnets into one block without wasting address space.

What you provide

Result

ISSUE

That input could not be read

"Link to branch" does not fit. The base block holds 256 addresses and the requests need more than that once each is rounded up to a power of two.

What this cannot tell you

  • IPv4 planning arithmetic. It does not read or change any device configuration.
  • It allocates address space and nothing else. Whether those subnets can route to each other, and what the firewall between them should allow, are separate design questions.

Take this with you

How this calculation works

Each requirement is rounded up to the smallest subnet that holds it, remembering that all but point-to-point links lose two addresses to the network and broadcast. The allocations are then laid out largest first, which is the whole technique rather than a preference: a block can only start on a boundary matching its own size, so allocating in request order leaves gaps that nothing fits into. Working downwards keeps every subnet aligned and packs the space with no waste.

What the results mean

Allocation plan
Each subnet with its network address, usable range and prefix, ready to configure. The order is by size rather than by the order you listed them.
Spare
Usable addresses left over in that subnet. Sizes only come in powers of two, so some spare is unavoidable, and a very small figure is a warning.
Address space used
How much of the base block the plan consumes. Above 90%, there is no room for a segment you have not thought of yet.

Common problems and fixes

A subnet has almost no spare addresses
Round the requirement up before planning rather than after. A segment needing exactly 30 hosts fits a /27 with no room at all once the network and broadcast addresses are taken, so the first printer added to it forces a renumber. Add growth to the requirement figures, since resizing a subnet in production means touching every device on it.
The plan does not fit in the base block
Add up the rounded sizes rather than the raw host counts, because the rounding is where the space goes. Four segments needing 33 hosts each occupy four /26 blocks, which is 256 addresses for 132 hosts. Either widen the base block by one bit or look at whether two small segments genuinely need to be separate.

Frequently asked questions

Why must the largest subnet be allocated first?

Because every block has to start at an address that is a multiple of its own size. If a /28 is placed first at the start of a /24, the next /25 cannot begin until halfway through the block, and the space in between is stranded. Descending order guarantees every block lands on a boundary it can legally use.

Why does a 50-host subnet need a /26?

A /26 holds 64 addresses, of which 62 are usable after the network and broadcast addresses are reserved. A /27 holds 32 and gives only 30 usable, which is not enough. Subnet sizes double at each step, so there is nothing in between.

Should point-to-point links use a /30 or a /31?

A /31 if the equipment supports it, which most modern routers do. RFC 3021 allows both addresses in a /31 to be used on a point-to-point link, since there is nobody to broadcast to. It halves the space a /30 wastes, and across a network with many links that adds up.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/vlsm-calculator/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="VLSM Subnet Planner" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/vlsm-calculator/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in NetMath