Skip to content
ToolMug

VLSM Calculator

Planning an office network, a homelab or a networking exam? List the subnets you need and how many hosts each must hold. The calculator gives each one the smallest block that fits, largest first, so nothing overlaps and little space is wasted — with network address, mask, usable range, broadcast and the free blocks that remain.

Runs in your browser — nothing you enter is uploaded

An IPv4 network in CIDR form, e.g. 10.0.0.0/16

Subnets and the number of hosts each needs

hosts
hosts
hosts
hosts

Allocated 228 of 256 addresses (89%)

SubnetHosts neededNetworkMaskUsable rangeBroadcastSpare hosts
Office100192.168.1.0/25255.255.255.128192.168.1.1 – 192.168.1.126192.168.1.12726
Guest Wi-Fi50192.168.1.128/26255.255.255.192192.168.1.129 – 192.168.1.190192.168.1.19112
Servers20192.168.1.192/27255.255.255.224192.168.1.193 – 192.168.1.222192.168.1.22310
Router link2192.168.1.224/30255.255.255.252192.168.1.225 – 192.168.1.226192.168.1.2270

Free blocks left: 192.168.1.228/30, 192.168.1.232/29, 192.168.1.240/28

Subnets are allocated largest first so every block starts on its natural boundary. Each subnet reserves a network and a broadcast address, so a /30 holds 2 hosts and a /24 holds 254.

How to use

  1. Enter the network to divide, such as 192.168.1.0/24 or 10.0.0.0/16.
  2. List each subnet with the number of hosts it needs; add or remove rows as needed.
  3. Read the allocation table, then copy it into your documentation or spreadsheet.

Options explained

Hosts needed
Devices that need an address, including the gateway. Each subnet also uses a network and a broadcast address.
Spare hosts
Addresses left in the block beyond what you asked for — room for growth.
Free blocks
Unallocated space after the last subnet, split into aligned blocks you can still assign.

Worked example

Divide 192.168.1.0/24 into four subnets needing 100, 50, 10 and 2 hosts. Each subnet gets the smallest block that holds its hosts plus the network and broadcast addresses, largest first:

Subnet Hosts needed Network Mask Usable range Broadcast Spare hosts
Engineering 100 192.168.1.0/25 255.255.255.128 .1 – .126 192.168.1.127 26
Sales 50 192.168.1.128/26 255.255.255.192 .129 – .190 192.168.1.191 12
Management 10 192.168.1.192/28 255.255.255.240 .193 – .206 192.168.1.207 4
Router link 2 192.168.1.208/30 255.255.255.252 .209 – .210 192.168.1.211 0

That uses 212 of the 256 addresses. The remaining 44 are listed under Free blocks left: 192.168.1.212/30, 192.168.1.216/29 and 192.168.1.224/27. The prefix is 32 minus the next whole power of two that fits (hosts + 2), so 100 hosts need 102 addresses, which rounds up to 128 and a /25.

Frequently asked questions

Why are subnets allocated from largest to smallest?

A block of 2ⁿ addresses must start at a multiple of 2ⁿ. Placing the largest blocks first keeps every later block aligned, so no addresses are lost to gaps.

How many hosts fit in a /30, /29 or /24?

2, 6 and 254 — the block size minus the network and broadcast addresses.

Does it support IPv6?

No. IPv6 subnets are normally all /64, so variable-length subnetting is mainly an IPv4 task. Use the IP Subnet (CIDR) Calculator for IPv6 networks.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools