VLSM Calculator
VLSM Planner
Allocate variable-length subnets from any network. Add subnet names and required hosts — the planner assigns optimised CIDR blocks using the largest-first algorithm, minimising waste.
How VLSM works
| Subnet name | Hosts required | CIDR needed |
|---|
| Subnet name | Network address | CIDR | Subnet mask | First host | Last host | Broadcast | Hosts req. | Hosts avail. | Waste |
|---|
VLSM — frequently asked questions
What is VLSM (Variable Length Subnet Mask)?
VLSM allows different subnets within the same network to use different prefix lengths. Unlike fixed-length subnetting where every subnet is the same size, VLSM lets you allocate exactly the right amount of address space to each subnet — dramatically reducing IP waste. For example, a /30 for a point-to-point WAN link and a /24 for a large LAN can both exist within the same /20 network.
What is the largest-first VLSM algorithm?
The largest-first algorithm sorts subnets by required size in descending order before allocating address space. The biggest subnet is assigned first, then each progressively smaller subnet follows. This ensures subnets align naturally to their block boundaries, prevents fragmentation, and makes it impossible for smaller subnets to accidentally consume space needed by larger ones.
How do I calculate the CIDR prefix for a required number of hosts?
Find the smallest power of 2 that is ≥ N+2 (where N is your required hosts — +2 accounts for the network and broadcast addresses). The prefix length = 32 minus that exponent. Example: 50 hosts → 50+2=52 → next power of 2 is 64 (2⁶) → prefix = 32−6 = /26, giving 62 usable hosts. This calculator does this automatically for every row you add.
What is the difference between VLSM and FLSM?
FLSM (Fixed Length Subnet Mask) divides a network into equal-sized subnets — every subnet gets the same prefix length. VLSM allows each subnet to have a different prefix length sized to its needs. VLSM is far more efficient but requires a classless routing protocol (OSPF, EIGRP, BGP, RIP v2) that carries prefix length in routing updates. RIP v1 does not support VLSM.
Which routing protocols support VLSM?
All classless routing protocols support VLSM because they include the subnet mask in their updates: OSPF, EIGRP, BGP, RIP v2, IS-IS, and static routes. RIP v1 and IGRP are classful — they do not carry subnet mask information and therefore cannot support VLSM or discontiguous networks.
What happens if my subnets don't fit in the base network?
The calculator will show an error specifying exactly how many addresses are needed versus available. To resolve it, either use a larger base network by reducing the CIDR prefix (e.g. /24 → /23 doubles the space), remove a subnet, or reduce host requirements. The tool shows you exactly how much space each requirement consumes so you can make precise adjustments.
What is address space efficiency in VLSM?
Efficiency is the ratio of hosts actually required to the total addresses consumed by all allocated CIDR blocks. Because CIDR block sizes are always powers of 2, some internal waste is inevitable when the required count isn't exactly a power of 2 minus 2. VLSM minimises this compared to FLSM. An efficiency above 80% is considered excellent for a real-world network design.
How do I use this VLSM calculator?
Enter your base network address and CIDR prefix in Step 1 (e.g. 192.168.1.0/24). In Step 2, click Add subnet for each subnet needed — give it a name and enter the required host count. Click Calculate VLSM to get optimised CIDR blocks, an address space visualiser, full results table, and CSV export.