Use variable-length subnet masks for different host needs
VLSM means variable-length subnet masking. Instead of giving every subnet the same size, you choose a prefix length that fits each requirement. A department needing 50 addresses and a small camera segment needing 10 addresses do not need equal blocks.
This calculator starts from one private IPv4 parent block. It sorts requirements from largest to smallest, chooses the smallest conventional LAN block that can hold each one, and allocates the blocks on valid boundaries. A result appears only when the complete plan fits. It is a planning calculation; it cannot determine which addresses are already occupied.
- Choose the private address space you are responsible for planning. Check it against your existing address plan before using it.
- Count all host-address requirements for each subnet, including its gateway and any intentional growth allowance.
- Enter one optional name and host count per line. Names help you recognize the rows after the calculator reorders them.
- Select Calculate plan and review the effective parent, network boundaries, host ranges and remaining address space.
For the details of one existing subnet, use the subnet mask cheat sheet and IPv4 calculator. To practise the arithmetic before planning a group of subnets, use the subnetting practice quiz.
Worked VLSM example: 50, 25 and 10 hosts in a /24
Use the fictional parent 192.168.10.0/24, containing 256 addresses. Office needs 50 hosts, Guest WiFi needs 25 and Cameras needs 10. Each conventional subnet needs two additional addresses for its network and directed-broadcast values.
| Subnet | Needed | Allocated CIDR | Host capacity | Conventional host range |
|---|---|---|---|---|
| Office | 50 | 192.168.10.0/26 | 62 | 192.168.10.1–192.168.10.62 |
| Guest WiFi | 25 | 192.168.10.64/27 | 30 | 192.168.10.65–192.168.10.94 |
| Cameras | 10 | 192.168.10.96/28 | 14 | 192.168.10.97–192.168.10.110 |
The Office block has 64 addresses, Guest WiFi has 32 and Cameras has 16. Together they occupy 112 addresses and supply 106 conventional host slots for 85 requested hosts. The remaining 144 addresses run from 192.168.10.112 to 192.168.10.255. That remaining range is address space for future planning, rather than one automatically assigned subnet.
The directed-broadcast values are 192.168.10.63, 192.168.10.95 and 192.168.10.111. Those addresses are outside the host ranges shown. Spare host slots remain inside each allocated subnet; they are different from addresses outside all the allocated blocks.
How the planner chooses each prefix and boundary
For a host requirement H, choose the smallest power-of-two address count B for which B − 2 ≥ H. The prefix is 32 minus the number of host bits needed for B. This tool uses a minimum four-address /30 block, even for a one-host request.
For example, 50 requested hosts plus two addresses requires at least 52 addresses. The next power of two is 64, so the allocation uses /26 and has 62 conventional host slots. A 63-host requirement cannot fit into that block; it needs 128 addresses, or /25, with 126 host slots.
Requirements are sorted by host count in descending order, with equal requests kept in their original order. Each allocation begins on a boundary divisible by its block size, stays inside the normalized parent and cannot overlap a prior allocation. This is a deterministic largest-first plan for an initially empty parent. It does not pack new subnets around existing reservations or optimize a live network.
RFC 4632 describes CIDR prefix notation. RFC 1878 provides an informational IPv4 subnet table linking prefix lengths, masks and address counts. RFC 1878 is a historic reference; this planner uses its mask arithmetic without treating its older classful terminology as a requirement for a modern plan.
Private parent blocks, normalization and excluded cases
This planner accepts blocks wholly inside the three private ranges reserved by RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A block beginning with a private address can still extend outside private space. For example, 192.168.0.0/15 is rejected because it includes addresses beyond 192.168.0.0/16.
If you enter 192.168.10.7/24, the effective block is 192.168.10.0/24. The calculator states that normalization in the result before listing allocations. Normalization changes the address to its network boundary; it does not shrink the prefix or start allocating from the host address you typed.
Allocated conventional LAN prefixes range from /8 through /30 within the permitted private parent. A /31 or /32 parent is rejected, and neither prefix is allocated. These special cases use different address interpretations. IPv6, public address allocation, loopback, link-local, carrier-grade shared space and other special-purpose ranges are outside this tool’s scope.
Private address space can overlap between organizations, VPNs, sites and cloud environments. A mathematically valid private plan does not establish that it is suitable for your routing, security or connectivity requirements.
Why a host total can fit while the rounded plan does not
Adding the host counts is not enough. Each subnet needs its own power-of-two block. In a /24, three requirements of 70 hosts total only 210 hosts. Each 70-host subnet needs a 128-address /25 block, so the plan needs 384 addresses and cannot fit into 256.
If the full rounded plan exceeds the parent, the calculator reports the required address count and the available address count. It shows no partial result. Review unrealistic growth allowances or select a larger private parent that you are authorized to use. Do not treat a failed plan as permission to reuse another network’s addresses.
Capacity describes conventional address slots, not active devices or DHCP leases. Count the addresses for gateways and infrastructure in your requirements. Review DHCP exclusions, static assignments, routing, segmentation and existing reservations separately before applying a plan.
Local calculation and practical next steps
The calculation runs in this page using integer address arithmetic. Parent addresses, subnet names and counts are not sent to an allocation service, saved in browser storage, placed into URLs or attached to analytics events by the planner. Editing an input hides the previous result. Reset restores the fictional example without calculating it; leaving the page clears the current values and plan.
This tool does not discover a public IP, contact private addresses, check DNS, inspect a router or test whether a subnet can reach the internet. Use DNS Lookup for a separate DNS-record query, or the IPv6 Connectivity Test for supported browser connectivity observations. The Internet Speed Test is a separate connection measurement.
Read our methods and limitations for the wider site approach, or browse all internet tools.
VLSM planning questions
What does a VLSM calculator do?
A VLSM calculator divides one IPv4 parent block into subnets of different sizes. This planner rounds each host requirement up to a power-of-two block, allocates the largest requirements first and shows aligned, non-overlapping subnet ranges. It performs address arithmetic without scanning or changing a network.
Why does the planner add two addresses to each host requirement?
For the conventional LAN subnets used here, one address identifies the subnet and the final address is its directed-broadcast value. The calculator therefore chooses a block with at least the requested hosts plus two addresses. A requirement of 50 hosts needs a 64-address /26 block with 62 conventional host slots.
Which parent networks and host counts are supported?
The entire parent must be inside 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16. Enter 1–20 subnet requirements, each from 1 to 16,777,214 hosts. Allocations use conventional LAN blocks no smaller than /30. The planner excludes /31, /32, IPv6 and public or other special-purpose ranges.
What happens if my parent address has host bits set or the plan is too large?
An address such as 192.168.10.7/24 is normalized to its network boundary, 192.168.10.0/24, with a visible notice. If all rounded subnet blocks do not fit, the calculator shows an error and no partial allocation. A high total of requested hosts can still fail because each subnet needs its own power-of-two block.
Does this planner save my network names or configure my router?
No. The planner calculates locally in this page and does not store the entered parent, names or host counts, add them to URLs or attach them to analytics events. Editing an input clears the old result. Reset restores the example; reloading or leaving the page clears the current plan. The output does not reserve addresses, create VLANs or configure routing.