DevTools Hub

Search tools

Search for a developer tool

Network Security

VLSM Subnet Calculator

Allocate variable-length subnets (VLSM) from a base network for a list of host-count requirements.

Part of the Network Security Toolkit
Base network

192.168.1.0/24

Addresses allocated

240 of 256

Remaining

16

Sales100 hosts needed
CIDR 192.168.1.0/25
Mask 255.255.255.128
Broadcast 192.168.1.127
Usable hosts 126
Host range 192.168.1.1 – 192.168.1.126
Engineering50 hosts needed
CIDR 192.168.1.128/26
Mask 255.255.255.192
Broadcast 192.168.1.191
Usable hosts 62
Host range 192.168.1.129 – 192.168.1.190
Support25 hosts needed
CIDR 192.168.1.192/27
Mask 255.255.255.224
Broadcast 192.168.1.223
Usable hosts 30
Host range 192.168.1.193 – 192.168.1.222
Lab10 hosts needed
CIDR 192.168.1.224/28
Mask 255.255.255.240
Broadcast 192.168.1.239
Usable hosts 14
Host range 192.168.1.225 – 192.168.1.238

What this does

Takes one base network and a list of required host counts, then carves out a differently sized subnet for each one — the minimum block that fits its host count, rather than splitting everything into equal shares. That's the whole point of VLSM (Variable Length Subnet Masking): a 500-host office and a 2-host point-to-point link don't need the same size block.

How the allocation order works

Subnets are packed into the base network largest-first, regardless of the order you type them in — that's what keeps every block aligned to a valid boundary for its own size. The results are still shown in the order you entered them; only the underlying address assignment is reordered. If a requested subnet doesn't fit in whatever space is left, it's flagged without blocking a smaller one later in the list from still succeeding.

Why the host count still costs you 2 extra addresses

Every subnet here reserves a network address and a broadcast address, so asking for 1 or 2 hosts still allocates a full /30 (4 addresses). That's the standard subnetting rule these calculations assume — for the point-to-point exception under RFC 3021, where a /31 gives you 2 directly usable addresses, see the CIDR Calculator.

FAQ

What does VLSM actually mean?

Variable Length Subnet Masking — instead of splitting a network into equal-sized subnets, you carve out a differently sized block for each group based on how many hosts it actually needs, so a 2-host point-to-point link doesn't waste the same /24 as a 500-host office.

Why are the subnets allocated largest-first instead of in the order I typed them?

Packing from biggest to smallest is what keeps every block correctly aligned to its own size — a /25 has to start on a multiple of 128, a /26 on a multiple of 64, and so on. Allocating in any other order can leave gaps that don't divide evenly. The results table still lists your subnets in the order you entered them; only the underlying address assignment is reordered.

Why does a request for 1 or 2 hosts still consume a /30?

This calculator reserves a network address and a broadcast address for every subnet, the classic subnetting rule, so the smallest block it ever hands out is a /30 (4 addresses, 2 usable). If you specifically need a 2-address point-to-point link without that overhead, see the RFC 3021 /31 case in the CIDR Calculator instead.

What happens if my subnets don't all fit in the base network?

Each request is checked against whatever address space is left. One that's too big to fit is marked so without stopping the rest — a smaller request later in the list can still succeed in the space that remains, the same way it would if you were subnetting by hand and skipped the one that didn't fit.

Is my data uploaded anywhere?

No — everything happens entirely in your browser. Nothing is sent to a server.

Learn more

For the full worked example this calculator's defaults are based on, plus why allocation order determines whether the blocks stay aligned, see VLSM Subnetting Explained.

Related tools