VLSM Calculator
Divide one IPv4 network into right-sized subnets, without overlaps or guesswork.
Network and subnets
IPv4 in CIDR form, such as 10.0.0.0/16 or 192.168.1.0/255.255.255.0.
For example “Sales 60”. Rows pasted from a spreadsheet and bare host counts work too.
6 subnets · 109 hosts
Subnet plan for 192.168.10.0/24
| Subnet | Hosts | Network and mask | Usable range | Broadcast | Unused |
|---|---|---|---|---|---|
| Sales 60 + 2 (network and broadcast) = 62 → next power of two: 64 = 2^6 → 32 − 6 = /26 | 60 of 62 | 192.168.10.0/26 255.255.255.192 | 192.168.10.1 – 192.168.10.62 | 192.168.10.63 | 2 |
| Engineering 28 + 2 (network and broadcast) = 30 → next power of two: 32 = 2^5 → 32 − 5 = /27 | 28 of 30 | 192.168.10.64/27 255.255.255.224 | 192.168.10.65 – 192.168.10.94 | 192.168.10.95 | 2 |
| HR 12 + 2 (network and broadcast) = 14 → next power of two: 16 = 2^4 → 32 − 4 = /28 | 12 of 14 | 192.168.10.96/28 255.255.255.240 | 192.168.10.97 – 192.168.10.110 | 192.168.10.111 | 2 |
| Management 5 + 2 (network and broadcast) = 7 → next power of two: 8 = 2^3 → 32 − 3 = /29 | 5 of 6 | 192.168.10.112/29 255.255.255.248 | 192.168.10.113 – 192.168.10.118 | 192.168.10.119 | 1 |
| WAN link A 2 + 2 (network and broadcast) = 4 → next power of two: 4 = 2^2 → 32 − 2 = /30 | 2 of 2 | 192.168.10.120/30 255.255.255.252 | 192.168.10.121 – 192.168.10.122 | 192.168.10.123 | 0 |
| WAN link B 2 + 2 (network and broadcast) = 4 → next power of two: 4 = 2^2 → 32 − 2 = /30 | 2 of 2 | 192.168.10.124/30 255.255.255.252 | 192.168.10.125 – 192.168.10.126 | 192.168.10.127 | 0 |
Free space
192.168.10.128/25
Open the free blocks in the IP range to CIDR converter · Subnet mask cheat sheet
About the VLSM Calculator
VLSM (variable-length subnet masking) gives every subnet only the addresses it needs instead of cutting a network into equal pieces. Enter the network you have — for example 192.168.10.0/24 — and one line per subnet with the number of hosts it must hold. The calculator picks the smallest block for each, places them largest first so none overlap and no space is lost between them, and shows the network address, subnet mask, usable range, broadcast address and unused addresses of each subnet, plus the space that is left.
Everything is calculated in your browser, and the step-by-step working (hosts + 2 → next power of two → prefix) is shown for every subnet, which makes it handy for checking CCNA-style subnetting exercises.
How to use it
- Type the network to divide in CIDR form, such as
10.0.0.0/16or192.168.1.0/255.255.255.0. - List the subnets, one per line: a name and the number of hosts, for example
Sales 60. A host count on its own (60) or pasted spreadsheet rows work too. - Choose the options you need: a growth allowance, /31 for two-host point-to-point links, /32 for single hosts, or keeping your own order.
- Read the plan: each subnet’s network, mask, usable range and broadcast address, with the address map and the free space below.
- Copy the table or download it as CSV for your documentation or IP address management tool.
Examples
192.168.10.0/24 Sales 60 · Engineering 28 · HR 12 · Management 5 · WAN link A 2 · WAN link B 2
Sales 192.168.10.0/26 .1 – .62 broadcast .63 Engineering 192.168.10.64/27 .65 – .94 broadcast .95 HR 192.168.10.96/28 .97 – .110 broadcast .111 Management 192.168.10.112/29 .113 – .118 broadcast .119 WAN link A 192.168.10.120/30 .121 – .122 broadcast .123 WAN link B 192.168.10.124/30 .125 – .126 broadcast .127 Free: 192.168.10.128/25
Sales needs 60 + 2 = 62 addresses, so it gets the next power of two, 64 = 2^6: a /26 (32 − 6). Half of the /24 is still free.
172.16.0.0/16 A 1000 · B 500 · C 250 · D 100 · E 50
A 172.16.0.0/22 · B 172.16.4.0/23 · C 172.16.6.0/24 · D 172.16.7.0/25 · E 172.16.7.128/26 Free: 172.16.7.192/26, 172.16.8.0/21, 172.16.16.0/20, 172.16.32.0/19, 172.16.64.0/18, 172.16.128.0/17
Common uses
- Planning the address scheme for a new office, VLANs or a cloud VPC before configuring anything.
- Checking a hand-worked VLSM answer for CCNA, CompTIA Network+ or university networking courses.
- Fitting new departments into the space left in an existing network without overlapping what is already used.
- Producing a clean table of networks, masks and gateways for documentation or an IPAM import.
How the sizes are chosen
A subnet with h host bits has 2^h addresses. The first is the network address and the last is the broadcast address, so 2^h − 2 are usable by hosts. For each subnet the calculator adds 2 to the hosts you ask for, rounds up to the next power of two and turns that into a prefix: 60 hosts → 62 → 64 = 2^6 → /26, with the mask 255.255.255.192.
Blocks are then placed from the start of your network, largest first. Because every block is a power of two and the larger ones come first, each block starts on a multiple of its own size — the rule every subnet must follow — and no addresses are wasted between blocks. All subnets fit exactly when their sizes add up to no more than the network. Subnet zero and the all-ones subnet are used like any other, as is standard practice (RFC 1878).
/31 links, /32 hosts and growth
- /31 for point-to-point links: a link between two routers needs two addresses. A /30 gives exactly two usable hosts but uses four addresses; RFC 3021 allows a /31 on point-to-point links, where both addresses are usable and there is no broadcast. Turn it on only if every device on those links supports it.
- /32 for single hosts: loopback addresses of routers are often a single /32.
- Growth allowance: adds a percentage to every host count before sizing (50 hosts + 20% = 60), so subnets do not run out as the site grows.
- Order: “Largest first” packs the plan with no gaps. “As listed” keeps your order — useful when addresses must ascend by department — but each block still has to start on its own boundary, so gaps can appear; they are listed as free space.
Reading the results
- Network / prefix: the subnet’s first address and its length, e.g. 192.168.10.64/27.
- Mask: the dotted subnet mask (255.255.255.224). The CSV adds its inverse, the wildcard mask (0.0.0.31) used in Cisco ACLs and OSPF network statements.
- Usable range: the addresses you can give to hosts and gateways. Many networks use the first usable address as the default gateway.
- Broadcast: the last address of the block (none for /31 and /32).
- Unused: usable addresses beyond the hosts you asked for.
- Free space: addresses no subnet uses, written as the fewest CIDR blocks, so you can hand them out later.
Limitations
- IPv4 only. IPv6 subnets are normally /64 each, so variable-length planning is rarely needed there.
- It plans a fresh layout from the start of the network; it does not work around subnets that are already in use. Plan new subnets inside one of the free blocks instead.
- Up to 1,000 subnets per plan.
- It does not reserve extra addresses for gateways, DHCP pools or first-hop redundancy (HSRP, VRRP); include them in the host counts.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
Why does a subnet for 60 hosts get 64 addresses and not 60?
Subnets come in powers of two, and two addresses of every block are reserved — the network address and the broadcast address. 60 hosts need 62 addresses, and the smallest power of two that holds 62 is 64, a /26.
Why are the subnets allocated largest first?
Every subnet must start on a multiple of its size (a /26 on .0, .64, .128 or .192). Placing the biggest blocks first means each following block automatically starts on a valid boundary, so nothing is wasted between them. Placing small ones first can leave gaps that larger blocks cannot use.
Can I use a /31 instead of a /30 for router links?
Yes, on point-to-point links, if both devices on the link support RFC 3021 — check the documentation of older routers and firewalls before relying on it. A /31 uses two addresses instead of four, both of them usable. Tick “/31 for two-host links”.
What does it mean when the plan does not fit?
The blocks need more addresses than your network has. The message gives the total and the smallest network that would hold everything, such as a /23. Use a larger network, reduce host counts, or use /31 for point-to-point links.
Is subnet zero allowed?
Yes. RFC 950 (1985) asked that the all-zeros and all-ones subnets not be used, but RFC 1878 includes them “per the current, standards-based practice for using all definable subnets” (RFC 1812), and modern equipment supports them. This calculator uses the whole range.
Which address should be the default gateway?
Any usable address works; by convention it is usually the first usable one (for example 192.168.10.1 in 192.168.10.0/26). Count the gateway as one of the subnet’s hosts.