Ad slot — header (728x90)

VLSM Calculator — Variable Length Subnet Masking

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 →

What Problem Does VLSM Solve?

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.

Worked Example: 192.168.10.0/24

Requirements: Engineering (50 hosts), Finance (25 hosts), IoT (5 hosts), Point-to-point link (2 hosts).

Step 1 — Sort by host count, largest first:

  1. Engineering: 50 hosts
  2. Finance: 25 hosts
  3. IoT: 5 hosts
  4. P2P link: 2 hosts

Step 2 — Find the smallest prefix that fits each requirement:

DepartmentHosts NeededPrefixTotal IPsUsableWasted
Engineering50/26646212
Finance25/2732305
IoT5/29861
P2P link2/30420

Step 3 — Assign sequential address blocks:

DepartmentNetworkRangeBroadcast
Engineering192.168.10.0/26.1 – .62.63
Finance192.168.10.64/27.65 – .94.95
IoT192.168.10.96/29.97 – .102.103
P2P link192.168.10.104/30.105 – .106.107
Unused192.168.10.108/30 onwardsAvailable for future growth

Total addresses used: 108 out of 256. A fixed /26 approach would have consumed 256 addresses with more waste.

VLSM Rules to Follow

VLSM Host Count Formula

To find the right prefix for n hosts: find the smallest k where 2k − 2 ≥ n, then the prefix is /( 32 − k ).

Hosts Neededk (bits)PrefixUsable
22/302
3–63/296
7–144/2814
15–305/2730
31–626/2662
63–1267/25126
127–2548/24254
Run the VLSM Planner with your real requirements →

Related Guides

Ad slot — footer (728x90)