Skip to content
SubnettingCalculator
IPv4 Detecting…
IPv6 Detecting…

VLSM Calculator – Variable Length Subnet Mask Calculator

Use this free VLSM calculator to split an IPv4 network into subnets of different sizes. Enter the hosts each subnet needs, such as 100,50,30, and get the network address, usable IP range, broadcast address and masks of every subnet, plus the free blocks left over. Good for real network design and CCNA practice.

VLSM Subnet Calculator

Enter a network, then type the hosts each subnet needs, separated by commas.

/24

What is VLSM?

VLSM stands for Variable Length Subnet Mask. Instead of cutting a network into equal pieces, you give each subnet only the size it needs. A floor with 100 devices gets a /25, a floor with 50 gets a /26, and a small lab with 30 gets a /27. Whatever is left over stays free for later.

That saves a lot of addresses compared with giving every subnet the same size. The price is a little more planning, and that is the part this calculator does for you. If you would rather have equal subnets, use the FLSM Calculator.

How to use this VLSM calculator

1Enter the network

Type any address from the network into IP Address, then set the Subnet Mask or drag the CIDR slider. You don't need the exact network address. If you type 192.168.1.0 with /21, the calculator starts from 192.168.0.0/21 and tells you so. The mask has to be /30 or shorter.

2List the hosts each subnet needs

Type the numbers into Hosts per Subnet, separated by commas, for example 100,50,30. Spaces are fine. No. of Subnets counts the numbers for you, so you can't edit it. Every number must be 1 or more.

3Click Calculate

The result appears below the form (pressing Enter works too). From then on it follows your changes, so you can add a number to the list and watch the tables update. If something is wrong, a red message under the box says what to fix.

4Read the result

The Variable Length Subnetting table lists your subnets, largest first. The Free/Unused IP Network table under it shows the space that is still free. Tick or untick boxes in Show Columns to choose what you see. On a phone or tablet that row slides sideways. The Network Address column is always shown.

5Copy, download or start again

Copy puts the tables on your clipboard and Download saves them as a CSV file. Both include the used and the free blocks, with a Status column, and only the columns you ticked. Clear All puts everything back to the starting values and hides the result.

Common slip-ups

  • I asked for 100 hosts and got 126. Sizes come in powers of 2, so 100 hosts rounds up to a /25, which holds 126.
  • My list came out in a different order. The subnets are placed largest first so that no space is lost. The names follow that order.
  • "These subnets need … addresses". The network is too small for the list. Use a shorter mask or lower some of the numbers.
  • "Too small to split". A /31 or /32 can't hold subnets with hosts in them.

How VLSM subnetting works

Every subnet is sized on its own, and then the subnets are placed one after the other, starting at the beginning of the network.

Addresses needed = hosts + 2 (network + broadcast address) Block size = smallest power of 2 that is >= addresses needed (at least 4) Prefix = 32 - log2(block size) Usable hosts = block size - 2

The steps are always the same:

  1. Work out the block size for every request.
  2. Sort the blocks from largest to smallest.
  3. Place the first block at the start of the network and each next block right after the one before it.
  4. Cut what is left over into the largest blocks that fit. Those are the free blocks.

Largest first matters because a block has to start on a multiple of its own size. A /25 can start at .0 or .128 but never at .64. Placing the big blocks first keeps every start address valid and leaves no holes.

Example: 192.168.1.0/21 with hosts 100, 50, 30

  1. The network address is 192.168.0.0/21, which has 2,048 addresses.
  2. 100 hosts need 102 addresses, so the block is 128, a /25. 50 hosts need 52, so 64, a /26. 30 hosts need 32, so 32, a /27.
  3. The three subnets use 224 addresses, one after the other.
  4. The other 1,824 addresses are free. They are cut into 4 blocks, listed in address order.

Variable Length Subnetting

Subnet NameNetwork AddressFirst Usable IPLast Usable IPBroadcast AddressTotal Usable HostsTotal Available HostsSubnet MaskWildcard Mask
Subnet 1192.168.0.0/25192.168.0.1192.168.0.126192.168.0.127126128255.255.255.1280.0.0.127
Subnet 2192.168.0.128/26192.168.0.129192.168.0.190192.168.0.1916264255.255.255.1920.0.0.63
Subnet 3192.168.0.192/27192.168.0.193192.168.0.222192.168.0.2233032255.255.255.2240.0.0.31

Free/Unused IP Network

Subnet NameNetwork AddressFirst Usable IPLast Usable IPBroadcast AddressTotal Usable HostsTotal Available HostsSubnet MaskWildcard Mask
Subnet 4192.168.0.224/27192.168.0.225192.168.0.254192.168.0.2553032255.255.255.2240.0.0.31
Subnet 5192.168.1.0/24192.168.1.1192.168.1.254192.168.1.255254256255.255.255.00.0.0.255
Subnet 6192.168.2.0/23192.168.2.1192.168.3.254192.168.3.255510512255.255.254.00.0.1.255
Subnet 7192.168.4.0/22192.168.4.1192.168.7.254192.168.7.2551,0221,024255.255.252.00.0.3.255

Which subnet size does a request need?

A quick reference. Find the number of hosts you need in the last column to see the prefix it gets.

PrefixSubnet maskAddressesUsable hostsHosts you can ask for
/30255.255.255.252421 – 2
/29255.255.255.248863 – 6
/28255.255.255.24016147 – 14
/27255.255.255.224323015 – 30
/26255.255.255.192646231 – 62
/25255.255.255.12812812663 – 126
/24255.255.255.0256254127 – 254
/23255.255.254.0512510255 – 510
/22255.255.252.01,0241,022511 – 1,022
/21255.255.248.02,0482,0461,023 – 2,046
/20255.255.240.04,0964,0942,047 – 4,094

Where VLSM works well

Use VLSM when your groups are different sizes: a head office with hundreds of devices, branch offices with a few dozen, and point-to-point links between routers that need only two addresses. It is also how most real networks are planned, because addresses are limited and growth is hard to predict.

A good habit is to leave some room. Ask for a few more hosts than you have today, and keep the free blocks for new subnets. To look closer at one subnet, put its network address and mask into the IPv4 Subnet Calculator.

Frequently asked questions

What does VLSM mean?

VLSM stands for Variable Length Subnet Mask. Each subnet gets only the size it needs, so subnets in the same network can use different masks. A subnet for 100 hosts can be a /25 while a subnet for 30 hosts is a /27.

How do I enter the hosts?

Type the number of hosts each subnet needs, separated by commas, for example 100,50,30. Spaces are fine. No. of Subnets counts the numbers for you and cannot be edited.

Why are the subnets listed largest first?

A subnet must start on an address that is a multiple of its own size. If you place the biggest blocks first, every block that follows lands on a correct start address and no space is lost between them. So the calculator sorts your list from largest to smallest, and names the subnets in that order.

Why does a subnet have more hosts than I asked for?

Subnet sizes come in powers of 2. A request for 100 hosts needs 102 addresses with the network and broadcast addresses, and the next size up is 128, which is a /25 with 126 usable hosts. The extra addresses stay in that subnet.

What if my subnets do not fit in the network?

The calculator tells you how many addresses are needed and how many the network has. Use a shorter mask, such as a /20 instead of a /21, or lower some of the host numbers.

What is the smallest subnet this calculator can make?

A /30, which has 2 usable hosts. Asking for 1 or 2 hosts gives a /30. The /31 used on router-to-router links is a special case, and you can check it in the IPv4 Subnet Calculator.

Can I enter the same number more than once?

Yes. 50,50,50 gives three separate /26 subnets.

Can I enter an address that is not the first one in the network?

Yes. If you type 192.168.1.0 with /21, the calculator starts from the network address 192.168.0.0/21 and tells you that it did.

How is the free space listed?

The free addresses start right after the last used subnet. They are cut into the largest blocks that fit, and the blocks are listed in address order. You can hand them out later without touching the subnets you already use.

How is VLSM different from FLSM?

FLSM cuts a network into subnets that are all the same size. VLSM lets each subnet be a different size, so it wastes fewer addresses. If you want equal subnets, use the FLSM Calculator.

Is anything I type sent to your server?

No. The calculation runs in your browser, so the networks you enter stay on your device.