Subnet calculator › Guides
What is VLSM? Designing variable-length subnets
How VLSM splits one network into subnets sized for each need: the rules, and a step-by-step design example.
VLSM means "subnets of different sizes"
VLSM (Variable Length Subnet Mask) splits one network into subnets sized for each need. Compared with cutting every subnet to the same size (FLSM), it saves a lot of address space.
Example: four networks out of 192.168.10.0/24
| Purpose | Devices needed |
|---|---|
| Engineering | 100 |
| Sales | 50 |
| Meeting room Wi-Fi | 20 |
| Router link | 2 |
With equal sizes, everything has to fit the biggest need (100 devices), so every subnet is a /25 (128 addresses). A /24 holds only two /25s — not enough for four networks — and the 2-device router link wastes 128 addresses.
VLSM in four steps
- Sort largest first: Engineering 100 → Sales 50 → Wi-Fi 20 → link 2
- Find each block size: the smallest power of two that holds devices + 2 (network and broadcast)
- Allocate in order: each block starts right after the previous one ends
- Record what is left for future use
| Purpose | Subnet | Usable range | Usable |
|---|---|---|---|
| Engineering | 192.168.10.0/25 | .1 - .126 | 126 |
| Sales | 192.168.10.128/26 | .129 - .190 | 62 |
| Meeting room Wi-Fi | 192.168.10.192/27 | .193 - .222 | 30 |
| Router link | 192.168.10.224/30 | .225 - .226 | 2 |
Free space left: 192.168.10.228/30, 192.168.10.232/29, 192.168.10.240/28.
Type "name devices" lines into the VLSM calculator and it does all of this for you.
Why allocate the largest first?
A subnet can only start at a multiple of its own size. A /26 (64 addresses) can start only at .0, .64, .128 or .192. Put a small /30 at .0 first and the /26 cannot start at .4 — it gets pushed to .64, leaving .4-.63 as an awkward gap. Allocating the largest first keeps every block aligned, with no gaps.
Practical tips
- Leave headroom: 1.5-2× the current need is typical. Growing a subnet later means renumbering.
- Consider /31 for router links: a /31 (RFC 3021) uses half the space of a /30. Check that your devices support it.
- Clouds reserve more: AWS reserves 5 addresses per subnet, so a /28 really gives 11.
- Plan for summarization: keep subnets for the same site or building contiguous so routes summarize into one.