VLSM subnet calculator
Enter the network you have and how many hosts each subnet needs. The calculator gives every subnet the smallest block that fits, places them largest first with no gaps, and lists the prefix, mask, host range and broadcast address of each.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Enter the network in CIDR form, for example
192.168.10.0/24.
- List the subnets one per line: a name, then the number of hosts. The name is optional.
- Read the table: each row is a subnet with its network, mask, first and last host and broadcast address. The line above it shows how much of the network is used.
How it works
- A subnet for h hosts needs h + 2 addresses (network and broadcast). That is rounded up to a power of two: prefix = 32 − ⌈log₂(h + 2)⌉.
- The requests are sorted from the largest to the smallest (equal sizes keep your order) and placed one after another from the start of the network.
- If the blocks add up to more than the network, the calculator says how many addresses are missing.
Example
The network 192.168.10.0/24 (256 addresses) and four subnets:
| Subnet |
Hosts |
Block |
Network |
Host range |
Broadcast |
| Sales |
60 |
64 |
192.168.10.0/26 |
.1 – .62 |
.63 |
| Engineering |
28 |
32 |
192.168.10.64/27 |
.65 – .94 |
.95 |
| HR |
12 |
16 |
192.168.10.96/28 |
.97 – .110 |
.111 |
| WAN link |
2 |
4 |
192.168.10.112/30 |
.113 – .114 |
.115 |
The blocks take 64 + 32 + 16 + 4 = 116 addresses: “Used 116 of 256 addresses (45.3%)”. The free range is 192.168.10.116 – 192.168.10.255 (140 addresses).
Tips
- Count every device that needs an address in the subnet, including the gateway on the router.
- Leave room: a subnet that is exactly full (62 hosts in a /26) cannot take one more device without renumbering.
- To look at one subnet in detail, paste it into the IP subnet calculator.
Frequently asked questions
What is VLSM?
Variable Length Subnet Masking: subnets of one network get different prefix lengths, sized to their needs. A link between two routers gets a /30 with 4 addresses, while an office of 60 computers gets a /26 with 64, instead of every subnet wasting the same large block.
Why does a subnet for 60 hosts get 64 addresses?
Each subnet loses two addresses: the first is the network address and the last is the broadcast address. 60 hosts need 62 addresses, and block sizes are powers of two, so the smallest block is 64 (/26), with 62 usable hosts.
Why are the largest subnets placed first?
A block must start on a multiple of its own size. Placing blocks from the largest to the smallest keeps every next block aligned automatically, so no addresses are lost in gaps.
Does it use /31 for point-to-point links?
No. Every subnet here keeps a network and a broadcast address, so 2 hosts get a /30. RFC 3021 allows /31 on point-to-point links, but not all equipment supports it.
Can I plan future growth?
Yes: enter the host count you expect later rather than today. The free range under the table shows what remains for new subnets.