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.
What Is VLSM?
How VLSM Allocation Works
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.