VLSM Calculator
Split an IPv4 network into subnets sized by the hosts each one needs, with masks, ranges, unallocated space and a /31 or /32 option.
How it works
required addresses = usable hosts + 2, rounded up to a power of two; prefix = 32 − log2(block size); /31 and /32 keep all their addresses
Sources
- RFC 950 — Internet Standard Subnetting Procedure (1985)
- RFC 4632 — CIDR Address Strategy (2006)
- RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links (2000)
- RFC 1918 — Address Allocation for Private Internets (1996)
How the block size is chosen
A subnet with a conventional mask loses its first address to the network and its last to the broadcast, so a request for 120 usable hosts needs 122 addresses. The block must be a power of two, so 122 becomes 128 and the prefix is 32 − 7 = /25.
That is the whole of VLSM: work out the smallest power-of-two block each requirement can live in, then place the big blocks first so the small ones fit into the leftovers without overlapping.
A /31 has two addresses and both are usable (RFC 3021), so a point-to-point link that needs 2 hosts takes 2 addresses, not 4. A /32 is a single host route with one address. Switch "Prefix handling" to "Always reserve network and broadcast" when your platform or policy does not support those prefixes.
Worked example
Take 10.20.0.0/22 — 1,024 addresses. The sample asks for 500, 250, 120, 60 and 2 hosts. Sizing gives 512 (/23), 256 (/24), 128 (/25), 64 (/26) and 2 (/31).
Largest first places them at 10.20.0.0/23, 10.20.2.0/24, 10.20.3.0/25, 10.20.3.128/26 and 10.20.3.192/31. That is 962 addresses allocated and 62 left over, all at the end of the parent where they are still usable as one block.
Allocate the same five in input order and the result is identical here, because the list already runs largest to smallest. Reorder the list — put the /31 first — and the small block takes the first address, leaving a gap that only small requests can use. That is what the "Unallocated address space" table exposes.
Reading the efficiency figure
Efficiency is allocated addresses ÷ parent addresses. A /22 holding 962 addresses reports 93.9%.
Because a block must be a power of two, some waste is structural: 500 hosts forces a 512-address block, so 12 addresses are unused before any planning mistake. The "Sizing check" section totals that structural waste so you can see whether a smaller parent or different requirement split would fit better.
Questions
Why does a subnet need two more addresses than its hosts?
The lowest address names the network and the highest is the broadcast address, so neither can be given to a device. /31 point-to-point links and /32 host routes are the exceptions: they reserve neither.
Why is the largest subnet allocated first?
Large blocks must start on a boundary that matches their size. Placing them first leaves one contiguous run of free space, which is the only arrangement where later small blocks can always be placed without wasting a hole.
Can I split a network without VLSM?
You can, but every subnet would get the same mask. That is fine when all segments need similar host counts; it wastes most of the space as soon as one segment needs hundreds of hosts and another needs two.