VLSM Calculator
Enter a base network and a list of required host counts (one per line, e.g. one per department). The calculator allocates the smallest fitting subnet for each, largest requirement first.
Input
Results
| Subnet | Required | Allocated | CIDR | Mask | Network | First Host | Last Host | Broadcast |
|---|
Overview
The VLSM (Variable-Length Subnet Mask) Calculator divides one address block into several differently sized subnets, one for each group of devices you list. Give it a base network such as 192.168.10.0/24 and a list of departments or VLANs with the number of hosts each needs, and it allocates the smallest suitable subnet to each.
It is useful for designing an addressing plan, for exam practice, and for checking whether a planned set of subnets fits in the block you have been assigned before you start configuring devices.
How It Works
For each requirement the tool finds the smallest prefix whose usable host count is at least the number requested (usable hosts are 2h − 2, so a request for 100 hosts needs 7 host bits — a /25 with 126 usable addresses — not 6). The requirements are sorted from largest to smallest and allocated one after another from the start of the base network.
Allocating largest-first matters because every subnet must start on a boundary that is a multiple of its own size. Placing big blocks first keeps them aligned and leaves the smaller blocks to fill whatever remains, which wastes the least space. If the next block would run past the end of the base network, the tool reports that the subnets cannot fit rather than producing an invalid plan.
How to Use the VLSM Calculator
- Enter the base network in CIDR form, for example
192.168.10.0/24. - In the requirements box, type one subnet per line as
name, number of hosts. - Press Calculate. The table lists each subnet's CIDR, mask, network address, host range, and broadcast address, in the order you entered them.
- Check the line under the table for how many addresses remain unallocated, and use Copy Results to document the plan.
Worked Example
Four departments in one /24
You have 192.168.10.0/24 and need subnets for Sales (100 hosts), Engineering (50), Support (25), and Guest Wi-Fi (10).
Input
Base network: 192.168.10.0/24
Sales, 100
Engineering, 50
Support, 25
Guest, 10
Output
Sales /25 192.168.10.0 hosts 192.168.10.1 - 192.168.10.126 broadcast 192.168.10.127 (126 usable, 100 required)
Engineering /26 192.168.10.128 hosts 192.168.10.129 - 192.168.10.190 broadcast 192.168.10.191 (62 usable, 50 required)
Support /27 192.168.10.192 hosts 192.168.10.193 - 192.168.10.222 broadcast 192.168.10.223 (30 usable, 25 required)
Guest /28 192.168.10.224 hosts 192.168.10.225 - 192.168.10.238 broadcast 192.168.10.239 (14 usable, 10 required)
Remaining unallocated addresses: 16
Sales needs 100 hosts, so it receives a /25 (126 usable) starting at the beginning of the block. Engineering's /26 (62 usable) starts at the next /26 boundary, 192.168.10.128; Support's /27 and Guest's /28 follow, each aligned to its own size. Together they use 240 of the 256 addresses.
The leftover space — from 192.168.10.240 to 192.168.10.255 — is unused address space that can be carved into smaller subnets later. Notice that each subnet has more usable addresses than requested (for example 14 for Guest versus 10 required); that rounding up is inherent to binary subnetting and leaves useful growth room.
Interpreting Results
- Required vs. allocated
- Required is what you asked for; allocated is the usable capacity of the block that was assigned. Allocated is always at least as large as required.
- CIDR / mask
- The prefix assigned to the subnet. A smaller prefix number means a larger subnet.
- First host / last host / broadcast
- The assignable range and the broadcast address for each subnet. Gateways normally take the first or last host address.
- Remaining addresses
- Addresses after the last allocated block that are still free. Free space between blocks can exist if alignment forces a gap.
Troubleshooting
- "The requested subnets cannot fit inside the specified network."
- The aligned blocks needed exceed the base network. For example, requests of 100, 100, and 50 hosts in a /24 need a /25, a /25, and a /26 — 128 + 128 + 64 = 320 addresses, more than the 256 available. Use a larger base block (a /23 would work) or reduce a requirement.
- A line is rejected as invalid.
- Each line must be
name, numberwith a positive whole number. Remove extra commas from names. - The allocated order differs from my list.
- Allocation happens largest-first, but the results are shown in the order you entered them. Each subnet's network address shows where it was actually placed.
Limitations and Accuracy
- IPv4 only, and it plans a single contiguous base block.
- Host counts do not include growth, gateways beyond one address, or extra reserved addresses some platforms require (AWS reserves five per subnet, for instance). Add headroom to your requirements.
- It does not check the plan against subnets that already exist elsewhere in your network.
- Very small requests follow the RFC 3021 point-to-point rules rather than the traditional /30: 1 host receives a /32, 2 hosts receive a /31, 3 hosts receive a /29, 6 hosts receive a /29. This tool never allocates a /30. If your equipment does not support /31, or you want the conventional /30 for a two-host link, plan that subnet by hand.
Data Handling
Runs in your browser. What you enter is processed on your device and is not sent to NetEngToolkit’s servers or to any third party.
Frequently Asked Questions
Why does a request for 100 hosts get a /25 and not a /26?
A /26 has 64 addresses and 62 usable hosts. A /25 has 128 addresses and 126 usable hosts, which is the smallest block that holds 100.
Does the order I list subnets in matter?
No. The calculator sorts them itself, largest first, and then displays results in your original order.
Why did a 2-host request come back as a /31 instead of a /30?
Because a /31 has exactly two usable addresses under RFC 3021, and the tool picks the smallest prefix that satisfies the request. Many devices support /31 on point-to-point links, but not all do, so confirm before using it.
Can I leave room for future growth?
Yes: increase the host counts you enter, or choose a larger base block than strictly needed.