VLSM Calculator
Divide a network into variable-size subnets using VLSM. Allocate IP addresses efficiently with minimum waste — enter your host requirements and get optimal subnets.
Reference table
| Subnet 4 — Required Hosts | Allocation Efficiency | Subnets Created | Total Addresses Allocated |
|---|---|---|---|
| 0.5 | 78.0% | 4 | 116 addresses |
| 1 | 78.4% | 4 | 116 addresses |
| 1.5 | 78.9% | 4 | 116 addresses |
| 2 | 79.3% | 4 | 116 addresses |
| 2.5 | 77.1% | 4 | 120 addresses |
| 3 | 77.5% | 4 | 120 addresses |
| 4 | 78.3% | 4 | 120 addresses |
| 5 | 79.2% | 4 | 120 addresses |
| 6 | 80.0% | 4 | 120 addresses |
| 7 | 75.8% | 4 | 128 addresses |
| 8 | 76.6% | 4 | 128 addresses |
| 9 | 77.3% | 4 | 128 addresses |
| 10 | 78.1% | 4 | 128 addresses |
| 12 | 79.7% | 4 | 128 addresses |
| 15 | 72.9% | 4 | 144 addresses |
VLSM Tips
- VLSM always allocates the largest subnet first, then works downward — this minimizes fragmentation.
- Each subnet loses 2 addresses (network + broadcast) — plan for this overhead.
- Add 10–20% to your host count for future growth before entering requirements.
- VLSM is more efficient than fixed subnetting: a /24 split with VLSM can save 30–50% of wasted IPs.
What Is VLSM?
How VLSM Allocation Works
VLSM Planning Guidelines
- Always sort subnets by size (largest first) before allocating — this prevents address space fragmentation.
- Each subnet must align to its block size: a /26 (64 addresses) must start at a multiple of 64.
- The minimum practical subnet is /30 (2 usable hosts) for router links; /28 (14 hosts) for device networks.
- Add 20% growth margin: if you need 100 hosts, plan for 120 — this still fits in a /25 (126 usable).
- Fixed subnetting a /24 into equal /26 blocks gives 4 × 62 = 248 hosts. VLSM can fit the same needs in fewer addresses.
- Document your VLSM plan carefully — variable-size subnets are harder to troubleshoot than fixed ones.
VLSM vs Fixed Subnetting Comparison
- Fixed /26 for 200 + 50 + 10: needs 4 subnets = 256 IPs, wastes 196 (23% efficiency).
- VLSM for 200 + 50 + 10: /24 + /26 + /28 = 336 IPs needed, but only 256 + 64 + 16 = 336 (77% efficiency).
- ISP allocation: VLSM lets ISPs give /28 to small clients, /24 to medium, /22 to large — from one /16 block.
- Campus network: admin (200 PCs) gets /24, lab (30 PCs) gets /27, security cams (8) get /28.
- Data center: production VLAN /23 (510 hosts), management /27 (30), out-of-band /29 (6).
- Home lab: main LAN /25 (126), IoT /28 (14), guest Wi-Fi /28 (14) — all from one /24.
VLSM Allocation Examples
Step-by-step subnet division
Office: 192.168.1.0/24 → 4 Subnets
- Requirements: Engineering (100), Sales (50), HR (20), Router links (2)
- Sort largest first: 100, 50, 20, 2
- Subnet 1: 100 hosts → need /25 (126 usable). Network: 192.168.1.0/25, range .1–.126
- Subnet 2: 50 hosts → need /26 (62 usable). Network: 192.168.1.128/26, range .129–.190
- Subnet 3: 20 hosts → need /27 (30 usable). Network: 192.168.1.192/27, range .193–.222
- Subnet 4: 2 hosts → need /30 (2 usable). Network: 192.168.1.224/30, range .225–.226
Used 200 of 256 addresses (78% efficiency). 56 addresses remain for growth.
Campus: 10.10.0.0/22 → 3 Buildings
- Total available: /22 = 1,022 usable addresses
- Requirements: Main building (500), Annex (200), Lab (50)
- Subnet 1: 500 → need /23 (510 usable). Network: 10.10.0.0/23, range .0.1–.1.254
- Subnet 2: 200 → need /24 (254 usable). Network: 10.10.2.0/24, range .2.1–.2.254
- Subnet 3: 50 → need /26 (62 usable). Network: 10.10.3.0/26, range .3.1–.3.62
- Remaining: 10.10.3.64/26 through 10.10.3.255 (192 addresses for future use)
Used 832 of 1,024 addresses. 192 remain — enough for two more /26 subnets.
Frequently Asked Questions
What is the difference between VLSM and CIDR?
CIDR (Classless Inter-Domain Routing) is the notation system that allows variable-length prefixes (e.g. /22, /27). VLSM (Variable Length Subnet Masking) is the technique of applying different CIDR prefix lengths to different subnets within the same address block. Think of CIDR as the language and VLSM as the design practice that uses it. VLSM requires CIDR-aware routing protocols like OSPF or EIGRP.
Which routing protocols support VLSM?
Modern protocols that carry subnet mask information support VLSM: OSPF (Open Shortest Path First), EIGRP (Enhanced Interior Gateway Routing Protocol), IS-IS, BGP, and RIPv2. The older RIPv1 does NOT support VLSM because it assumes classful boundaries and doesn't include the mask in routing updates. Static routes also support VLSM since the mask is manually specified.
Why must I sort subnets from largest to smallest?
Subnets must align to their block size — a /26 (64 addresses) must start at a multiple of 64. If you allocate a small subnet first, you may create a gap that wastes addresses because the next larger subnet can't fit there. Sorting largest-first ensures each block starts at a naturally aligned boundary, maximizing usable space and preventing fragmentation.
How do I know what subnet size I need for N hosts?
Find the smallest power of 2 that is greater than N + 2 (the +2 accounts for network and broadcast addresses). For 100 hosts: 100 + 2 = 102, next power of 2 is 128 = 2⁷, so host bits = 7, prefix = 32 − 7 = /25 (126 usable). For 50 hosts: 52 → 64 = 2⁶ → /26 (62 usable). For 10 hosts: 12 → 16 = 2⁴ → /28 (14 usable).
Can I use VLSM with IPv6?
IPv6 uses a fixed /64 prefix for all host subnets as recommended by RFC 4291, giving each subnet 2⁶⁴ addresses — more than enough for any LAN. VLSM-style variable prefixes are used at higher levels (between /48 and /64) for allocating subnets to departments, but within each subnet the size is always /64. The massive address space of IPv6 eliminates the need for VLSM at the host level.
What happens if my hosts don't fit in the network block?
If the total required addresses exceed the available space in your major network, the VLSM calculation fails. For example, trying to fit 200 + 100 + 50 hosts into a /24 (254 total addresses) won't work because you need /24 (256) + /25 (128) + /26 (64) = 448 addresses. Solution: use a larger network block (like /23 or /22) or reduce your host requirements.