What Is VLSM?

Variable Length Subnet Masking (VLSM) is a subnetting technique that allows network administrators to divide an IP address space into subnets of different sizes. Unlike fixed-length subnetting where every subnet must be the same size, VLSM allocates exactly the address space each subnet needs, minimizing wasted IP addresses.

VLSM is essential for efficient IP address planning in enterprise networks. For example, a point-to-point WAN link only needs a /30 (2 usable hosts), while a user VLAN might need a /22 (1,022 usable hosts). Without VLSM, you would need to allocate the same large subnet size to every network segment, wasting thousands of addresses on small links.

VLSM vs Fixed-Length Subnetting

FeatureFixed-Length (FLSM)Variable-Length (VLSM)
Subnet sizesAll identicalDifferent per subnet
Address wasteHighMinimal
Planning complexitySimpleModerate
Routing protocol supportClassful (RIPv1)Classless (OSPF, EIGRP, BGP)
Use caseSimple, uniform networksEnterprise, multi-site networks

How to Use This VLSM Calculator

  1. Enter your parent CIDR block (e.g., 10.0.0.0/16) — this is the address space you want to divide.
  2. Add subnet requirements by name and host count. For example: "Servers" needing 500 hosts, "Users" needing 200 hosts, "Management" needing 10 hosts.
  3. The calculator allocates subnets using a greedy algorithm — largest subnets first — to ensure optimal packing with minimal waste.
  4. Review the allocation table showing each subnet's network address, broadcast address, usable range, and utilization percentage.
  5. Share the URL — your allocation is encoded in the URL so you can bookmark or share it with your team.

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, /30). VLSM is the practice of applying CIDR within a single allocated address block to create subnets of different sizes. CIDR is the notation; VLSM is the subnetting strategy that uses it.

Why are subnets allocated largest-first?

The greedy algorithm allocates the largest subnet first because larger subnets have stricter alignment requirements — a /22 must start on a boundary divisible by 1,024. Allocating large subnets first prevents fragmentation where a large subnet cannot fit because smaller allocations have broken up the contiguous address space.

How many usable hosts are in each subnet size?

The formula is 2^(32 - prefix length) - 2 for IPv4. The "minus 2" accounts for the network address and broadcast address. For example: /24 = 254 hosts, /25 = 126 hosts, /26 = 62 hosts, /27 = 30 hosts, /28 = 14 hosts, /29 = 6 hosts, /30 = 2 hosts. A /31 is a special case used for point-to-point links with 2 usable addresses (no broadcast).

Which routing protocols support VLSM?

All modern (classless) routing protocols support VLSM: OSPF, EIGRP, IS-IS, BGP, and RIPv2. The only common protocol that does not support VLSM is RIPv1, which is classful and assumes all subnets of a given network have the same mask. If your network uses VLSM, ensure your routing protocol carries subnet mask information in its updates.

Can I use VLSM with IPv6?

IPv6 uses a /64 prefix for all standard subnets by convention (RFC 4291), so VLSM is less commonly applied at the host level. However, the concept of variable-length prefixes is fundamental to IPv6 address planning at the site and organization level — you might allocate /48s to sites, /56s to buildings, and /64s to VLANs. The address space is large enough that host-level efficiency is not a concern.