Give the major network and a list of subnets with the number of hosts each one needs. The calculator picks the smallest prefix for every subnet, allocates them largest-first without overlaps and shows the full address plan plus what is left over.
Last updated:
%
Extra hosts to plan for in every subnet
Enter your values to see the result.
Advertisement
Advertisement
How to use the VLSM Calculator
Enter the major network you were given, such as 192.168.1.0/24.
List the subnets, one per line, as a name and host count: Sales 60.
Set options: growth allowance, largest-first sorting and /31 links.
Press Calculate VLSM and check the allocation table and free space.
Download the CSV or copy the results for your documentation.
VLSM step by step
Size each subnet. Hosts + 2 (network and broadcast) rounded up to a power of two gives the block size; prefix = 32 − log2(size).
Sort the subnets from largest to smallest.
Allocate the first block at the start of the major network, the next block right after it, and so on.
Write down the network, first and last usable host and broadcast for each block; whatever remains is free for later.
Example with 192.168.1.0/24: Sales 60 hosts → /26 = 192.168.1.0-63; Engineering 28 → /27 = .64-.95; HR 12 → /28 = .96-.111; Management 5 → /29 = .112-.119; two WAN links → /30 = .120-.123 and .124-.127. The upper half, 192.168.1.128/25, stays free.
Hosts to prefix reference
Hosts needed
Prefix
Mask
Block size
Usable hosts
2
/30
255.255.255.252
4
2
3-6
/29
255.255.255.248
8
6
7-14
/28
255.255.255.240
16
14
15-30
/27
255.255.255.224
32
30
31-62
/26
255.255.255.192
64
62
63-126
/25
255.255.255.128
128
126
127-254
/24
255.255.255.0
256
254
255-510
/23
255.255.254.0
512
510
511-1,022
/22
255.255.252.0
1,024
1,022
1,023-2,046
/21
255.255.248.0
2,048
2,046
Planning tips
Count gateways, printers, access points and servers as hosts, not just user devices.
Keep the free space contiguous (largest-first does this) so a future large subnet still fits.
Group related subnets so they can be summarised into one route later.
Frequently asked questions
What is VLSM?
Variable Length Subnet Masking lets one network be divided into subnets of different sizes. Instead of giving every segment the same mask, each gets the smallest block that fits its hosts, which saves address space compared with fixed-length subnetting.
How do I find the prefix for a number of hosts?
Find the smallest n where 2^n − 2 is at least the number of hosts; the prefix is 32 − n. For 60 hosts, 2^6 − 2 = 62 is enough, so the subnet is a /26. For 28 hosts, 2^5 − 2 = 30, a /27.
Why allocate the largest subnet first?
Each block must start on a multiple of its own size. Allocating from largest to smallest means every next block starts on a correctly aligned address automatically, so there are no wasted gaps and no overlaps.
Why do 2 hosts need a /30?
A /30 has 4 addresses: the network address, two usable hosts and the broadcast address. On point-to-point links RFC 3021 allows a /31 with 2 usable addresses and no network or broadcast; enable that option if your equipment supports it.
What if my subnets do not fit?
The calculator places as many as it can and tells you which ones failed, how many addresses are needed in total and the shortest prefix that would hold all of them, for example a /23 instead of a /24.
Should I add room for growth?
Usually yes. A growth allowance of 10 to 25 percent avoids renumbering when a department grows, at the cost of using more address space. Private ranges like 10.0.0.0/8 make generous sizing easy.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.