Last reviewed: May 2026
Variable Length Subnet Masking (VLSM) lets you assign different prefix lengths to different subnets within the same network. Instead of wasting addresses by giving every segment a /24, VLSM sizes each subnet to exactly what it needs — conserving IP space and simplifying routing tables.
Open the VLSM Planner in SubnetSolver →Before VLSM, classful networking forced every subnet to have the same mask. If you had three departments needing 50, 25, and 5 hosts respectively, you'd assign three /26 blocks — wasting 127 addresses in the smallest department. VLSM allocates a /26 for 50 hosts, a /27 for 25 hosts, and a /29 for 5 hosts.
Requirements: Engineering (50 hosts), Finance (25 hosts), IoT (5 hosts), Point-to-point link (2 hosts).
Step 1 — Sort by host count, largest first:
Step 2 — Find the smallest prefix that fits each requirement:
| Department | Hosts Needed | Prefix | Total IPs | Usable | Wasted |
|---|---|---|---|---|---|
| Engineering | 50 | /26 | 64 | 62 | 12 |
| Finance | 25 | /27 | 32 | 30 | 5 |
| IoT | 5 | /29 | 8 | 6 | 1 |
| P2P link | 2 | /30 | 4 | 2 | 0 |
Step 3 — Assign sequential address blocks:
| Department | Network | Range | Broadcast |
|---|---|---|---|
| Engineering | 192.168.10.0/26 | .1 – .62 | .63 |
| Finance | 192.168.10.64/27 | .65 – .94 | .95 |
| IoT | 192.168.10.96/29 | .97 – .102 | .103 |
| P2P link | 192.168.10.104/30 | .105 – .106 | .107 |
| Unused | 192.168.10.108/30 onwards | Available for future growth | |
Total addresses used: 108 out of 256. A fixed /26 approach would have consumed 256 addresses with more waste.
To find the right prefix for n hosts: find the smallest k where 2k − 2 ≥ n, then the prefix is /( 32 − k ).
| Hosts Needed | k (bits) | Prefix | Usable |
|---|---|---|---|
| 2 | 2 | /30 | 2 |
| 3–6 | 3 | /29 | 6 |
| 7–14 | 4 | /28 | 14 |
| 15–30 | 5 | /27 | 30 |
| 31–62 | 6 | /26 | 62 |
| 63–126 | 7 | /25 | 126 |
| 127–254 | 8 | /24 | 254 |