VLSM Calculator
Allocate a base network across required host counts with variable-length subnet masking.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Allocated 3 subnet(s) from 192.168.0.0/24.
How it works
- Sorted the requested host counts from largest to smallest.
- For each requirement, chose the smallest prefix whose usable host count fits.
- Aligned the block to its size and advanced the allocation cursor.
- Reported the remaining space starting at 192.168.0.224.
block size = 2^(32 − prefix); usable = block size − 2- The largest requirement is allocated first, which is what makes the plan fit as often as possible.
- A requirement larger than the base block is reported as an error rather than silently dropped.
Methodology
- Parse the base CIDR block and the list of required host counts.
- Sort requirements descending and choose the smallest prefix that fits each.
- Align each block to its size, advance the cursor and detect exhaustion.
- Report every segment plus the remaining address space.
Usage
- Enter the base CIDR block.
- List one required host count per line (or comma separated).
- Run the allocation and copy the plan.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Three departments in a /24
{
"base": "192.168.0.0/24",
"requirements": "100\n50\n20"
}Two point-to-point links and a /25
{
"base": "10.0.0.0/24",
"requirements": "120,2,2"
}Limitations
Why VLSM exists
A single subnet size wastes address space when a site has very different needs: a transit link needs two addresses while a user LAN might need hundreds. VLSM lets each segment choose its own prefix so the address plan fits the requirements.
Allocating the largest block first is the common heuristic: it keeps the alignment simple and leaves the most room for the smaller blocks that follow.
Frequently asked questions
- Which subnet is allocated first?
- The largest requirement is allocated first so the smaller blocks can fill the remaining space; this is the standard VLSM heuristic.
- What if my requirements do not fit?
- The tool reports the point at which the base block ran out and lists the successfully allocated segments, without throwing.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.