VLSM: splitting a range by real host requirements
In one line: Why equal-size FLSM wastes space, and how VLSM places the largest requirement first, aligns every block and reports the leftover space.
Departments rarely need the same number of hosts, so cutting a range into equal subnets wastes addresses. VLSM (Variable Length Subnet Masking) gives each subnet its own prefix length. There is one rule that makes it work: place the largest host requirement first.
Where FLSM wastes space
Split 192.0.2.0/24 into four equal /26 blocks and each holds 62 hosts. If the requirements are 100, 50, 25 and 2, the first block cannot hold 100, while the 2-host link still gets 62 addresses.
The VLSM procedure
- Sort the requirements from largest to smallest: 100, 50, 25, 2.
- Add the two reserved addresses of each new subnet: 102, 52, 27, 4.
- Pick the smallest power of two that fits and its prefix: 128→/25, 64→/26, 32→/27, 4→/30.
- Place them from the start of the parent, each at an address that is a multiple of its own size.
| Need | Addresses | Subnet | Range | Usable |
|---|---|---|---|---|
| 100 | 102 | 192.0.2.0/25 | .0 – .127 | 126 |
| 50 | 52 | 192.0.2.128/26 | .128 – .191 | 62 |
| 25 | 27 | 192.0.2.192/27 | .192 – .223 | 30 |
| 2 | 4 | 192.0.2.224/30 | .224 – .227 | 2 |
The remaining space is .228 – .255. Written back as CIDR it becomes 192.0.2.228/30, 192.0.2.232/29 and 192.0.2.240/28. CidrPlan computes that leftover automatically.
Why alignment matters
A CIDR block must start at a multiple of its size: a /27 starts at a multiple of 32, a /26 at a multiple of 64. Placing large blocks first keeps every later block naturally aligned. Put a small block first and the gap behind it may be too small for the next large block.
largest first: /25 (.0) /26 (.128) /27 (.192) /30 (.224) → left .228-.255 smallest first: /30 (.0) /27 (.32) ... then no aligned /26 left
FLSM or VLSM?
FLSM is easier to operate when the requirements are similar and the count is small. VLSM saves addresses when requirements vary widely, at the cost of documentation: every prefix now has a reason. Keep a table of which subnet came from which requirement — the CSV and Markdown export is there for that.
Everything is calculated in your browser. The ranges you type are not stored on a server.
Back to the CIDR calculatorFrequently asked questions
Which prefix does a two-host point-to-point link need?
A /30 holds 4 addresses, 2 usable. On a true point-to-point link a /31 (RFC 3021) gives both addresses to hosts.
Is a /25 enough for 100 hosts?
Yes. A /25 holds 128 addresses with 126 usable, so 100 fits. A /26 with 62 usable does not.
Why does the leftover space appear as several blocks?
A leftover range has to be expressed as aligned CIDR blocks. One contiguous range can need a /30, a /29 and a /28 depending on where it starts.
Sources
- RFC 1918 — Address Allocation for Private Internets
- RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 5737 — IPv4 Address Blocks Reserved for Documentation
Read next
- CIDR notation and subnet masks from the ground upWhat 192.0.2.0/24 actually means: network and broadcast addresses, usable host counts, subnet masks and wildcard masks in one place.
- Designing AWS VPC subnets around five reserved IPsVPC CIDR is /16 to /28, five addresses are reserved in every subnet, and a /28 leaves only 11. Sizing rules, an availability-zone layout and Terraform.
- IPv6 notation and exact 128-bit arithmeticEight groups, :: compression and RFC 5952, why /64 is the standard subnet, and the Subnet-Router anycast that replaces broadcast.