VLSM calculator

Enter the base network and how many hosts each subnet needs. The calculator gives each one the right-sized mask, largest first.

228 of 256 addresses allocated (89%).

SubnetHosts neededHosts availableNetworkHost rangeBroadcast
VLAN 10100126192.168.10.0/25192.168.10.1 – 192.168.10.126192.168.10.127
VLAN 205062192.168.10.128/26192.168.10.129 – 192.168.10.190192.168.10.191
VLAN 302030192.168.10.192/27192.168.10.193 – 192.168.10.222192.168.10.223
WAN22192.168.10.224/30192.168.10.225 – 192.168.10.226192.168.10.227

Still free: 192.168.10.228/30, 192.168.10.232/29, 192.168.10.240/28

How to do a VLSM calculation

  1. Enter the base network you need to split, for example 192.168.10.0/24.

  2. Add one row per subnet with its name and the number of hosts it needs.

  3. Click “Calculate”: you will see each subnet's network, mask and range, and the blocks left free.

What is VLSM?

VLSM (Variable Length Subnet Mask) means splitting a network into subnets of different sizes, each with the mask it needs. If one department has 100 hosts and a link between routers only has 2, there is no point giving them the same block: with VLSM the first gets a /25 and the second a /30.

It is the standard way to design addressing in companies and the method asked for in networking exams, because it uses the address space far better than splitting into equal subnets.

The method, step by step

  • Sort the subnets from the most hosts to the fewest.
  • For each one, find the power of 2 that covers its hosts plus 2 (network and broadcast): 100 hosts need 128 addresses, that is a /25.
  • Place the first subnet at the start of the base network and each following one right after the previous one.
  • Going from largest to smallest, every block starts on a multiple of its size and no gaps are left between subnets.

With the network 192.168.10.0/24 and subnets of 100, 50, 20 and 2 hosts, the result is 192.168.10.0/25, 192.168.10.128/26, 192.168.10.192/27 and 192.168.10.224/30, leaving 28 addresses free for growth.

Design tips

Leave room to grow: if a department has 50 hosts today, think about how many it will have in two years. Keep the free blocks at the end of the network for new subnets and document every allocation. On point-to-point links between routers, a /30 (or a /31 if your equipment supports it) is enough.

A complete example for a company

Picture an office with the network 10.20.0.0/22 (1,024 addresses) that needs: 300 workstations, 120 devices on the guest Wi-Fi, 60 IP phones, 25 printers and cameras, and two links between routers.

  • Workstations (300 hosts): /23, 10.20.0.0 – 10.20.1.255, with 510 hosts available.
  • Guests (120): /25, starting at 10.20.2.0, with 126 hosts.
  • Phones (60): /26, starting at 10.20.2.128, with 62 hosts.
  • Printers and cameras (25): /27, starting at 10.20.2.192, with 30 hosts.
  • Links (2 each): two /30 from 10.20.2.224.

That leaves 280 addresses free (10.20.2.232/29, 10.20.2.240/28 and 10.20.3.0/24) for new subnets. Try entering these figures in the calculator to see the full result.

Frequently asked questions

What is the difference between VLSM and classic subnetting?

In classic subnetting every subnet has the same mask. With VLSM each one has the mask it needs, so far fewer addresses are wasted.

Why sort from largest to smallest?

Because that way each subnet starts on an address aligned with its size. If you place the small ones first, the large ones do not fit and unusable gaps are left.

What if the subnets don't fit?

The calculator warns you. You need a larger base network (for example a /23 instead of a /24) or fewer hosts in some subnet.

How many hosts fit in each mask?

Usable hosts are 2ⁿ − 2, where n is the number of host bits: /30 = 2, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126 and /24 = 254.

Does VLSM work with every routing protocol?

With classless protocols, which are all the current ones: OSPF, EIGRP, IS-IS, BGP and RIPv2. RIPv1 and IGRP do not send the mask and do not support VLSM.