🧮 VLSM Calculator
Enter a base network in CIDR notation and a comma-separated list of required host counts (largest first works best) to plan variable length subnets that fit each requirement with minimal waste.
How each subnet gets sized and placed
For every host count you list, the page walks prefixes from /30 upward and stops at the first block big enough, then hands out blocks back to back from the start of your base network:
block size = 2^(32 - prefix)
usable = block size - 2 (block size itself at /31 and /32)
pick the largest prefix where usable >= hosts needed
next network = previous network + its block size
With the defaults, 192.168.1.0/24 and 50, 20, 10, 2, the 50-host group needs a /26 because a /27 offers only 30 usable addresses. That takes 192.168.1.0 to .63. Twenty hosts fit a /27, .64 to .95; ten fit a /28, .96 to .111; two fit a /30, .112 to .115. That uses 116 of the 256 addresses.
Reading and steering the plan
- Enter hosts you need, not addresses. A group of 30 machines needs a /27 (30 usable), not a /28.
- Order does not matter. The tool sorts your list largest first before allocating, then puts the rows back in the order you typed.
- The smallest block it will issue is a /30. Ask for 1 host and you still get four addresses, because a /31 or /32 is treated as a special case rather than a general-purpose subnet.
Frequently asked questions
What is VLSM in networking?
Variable Length Subnet Masking: splitting one block into subnets of different sizes instead of equal ones, so a 50-user LAN and a two-address router link each get a mask that fits.
Can 50, 20, 10 and 2 hosts fit inside a single /24?
Yes, comfortably. They need a /26, a /27, a /28 and a /30 - 116 addresses in total, leaving 140 of the 256 spare.
Why allocate the biggest subnet first?
Every block has to start on a multiple of its own size. Place a /28 at the top of a /24 and the space left will not hold an aligned /26, so the largest requirement is fitted first and the smaller ones slot into what remains.