VLSM Calculator
Enter the address block you have and how many hosts each subnet needs. The calculator sorts the subnets largest first, gives each the smallest block that fits, packs them from the start of the network and lists what is left as CIDR blocks. Everything is worked out on this page.
Paste a list instead
How to use
- Enter the major network in CIDR form, such as 192.168.10.0/24 (a dotted mask like 192.168.10.0 255.255.255.0 also works).
- Add one row per subnet with a name and the number of hosts it needs. Use Add subnet for more rows, or open Paste a list to enter them as "name hosts" lines.
- Tick the /31 option if your two-host router links support RFC 3021 point-to-point addressing.
- Read the table: each subnet's network and prefix, mask, first and last usable address, broadcast and unused addresses. The summary shows the space used and the free blocks left.
- Use Copy table for a plain-text version, or Copy CSV / Download .csv to take the plan into a spreadsheet.
Examples
A 192.168.1.0/25 · B 192.168.1.128/26 · C 192.168.1.192/27 · D 192.168.1.224/30 — free: 192.168.1.228/30, 192.168.1.232/29, 192.168.1.240/28
172.16.0.0/22 (1,022 usable) · 172.16.4.0/23 (510) · 172.16.6.0/24 (254)
10.0.0.0/31, 10.0.0.2/31, 10.0.0.4/31, 10.0.0.6/31 (without the option they need a /28)
Error: the subnets need 384 addresses but the /24 has only 256 — a /23 or larger would be needed.
Supported formats
- Major network: IPv4 CIDR (10.0.0.0/16) or address plus dotted mask (10.0.0.0 255.255.0.0), /0 to /32. An address with host bits set, such as 10.0.0.5/24, is moved down to its network address and the page says so.
- Pasted lists: one subnet per line, name then host count, separated by a space, tab, comma or colon ("Sales 100", "WAN link: 2"). A line with only a number gets a default name; lines starting with # are skipped.
- Output: a table on the page, aligned plain text, or CSV with the columns Name, Hosts needed, Hosts available, Network, Mask, First usable, Last usable, Broadcast, Wasted.
Privacy
This tool runs entirely in your browser. Nothing you enter or open is sent anywhere. Privacy policy.
Limitations
- IPv4 only.
- Subnets are placed largest first and packed from the start of the network. It does not keep gaps for growth, reserve particular ranges, or fit around addresses that are already in use.
- Every subnet reserves a network and a broadcast address, so 1 or 2 hosts get a /30. With the /31 option ticked, they get a /31 instead (RFC 3021, both addresses usable). The calculator never assigns a /32.
- Host counts are not rounded up for growth or for gateway addresses. Add those to the number you enter.
FAQ
What is VLSM?
Variable-length subnet masking gives each subnet a prefix that matches its size, rather than cutting the network into equal pieces. A 100-host LAN gets a /25 and a router link gets a /30 from the same block, which wastes far fewer addresses than giving every subnet a /25.
Why are the subnets allocated largest first?
Every block must start on a multiple of its own size. Placing the biggest blocks first, in descending order, means each one lands on a valid boundary with no gaps between them, and all the free space ends up in one run at the end.
How is the block size chosen?
A subnet needs its hosts plus two addresses (network and broadcast), rounded up to the next power of two. 50 hosts need 52 addresses, so the block is 64 (/26), leaving 62 usable, 12 more than you asked for. Those 12 are shown in the Wasted column.
When should I use /31 links?
On point-to-point links between two routers that support RFC 3021, which most current router operating systems do. A /31 has two addresses and both are usable, so it uses half the space of a /30. Leave the option off for links to devices that expect a broadcast address.
What happens if the subnets do not fit?
The calculator says how many addresses the plan needs, how many the network has, which subnet is the first that does not fit, and the smallest prefix that would hold everything.