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.

The block to divide. Use its network address, for example 10.20.0.0/22.

Allocation order

Largest first packs the block with the least waste. Input order keeps your list order and leaves gaps.

A /31 point-to-point link has two usable addresses and no broadcast, so it does not lose two to reservation.

Subnet requirements

Name, usable hosts, optional description. Import CSV with those three columns in that order.

Subnet requirements
SubnetUsable hostsDescriptionRemove

Subnets allocated

5 from 10.20.0.0/22

93.9% of the parent is allocated; 62 addresses remain.

  • Core10.20.0.0/23
  • Engineering10.20.2.0/24
  • Voice10.20.3.0/25
  • Guest Wi-Fi10.20.3.128/26
  • WAN link10.20.3.192/31
  • Unallocated62

Each block's share of 10.20.0.0/22. Hover or read the legend for the CIDR.

  • Parent network10.20.0.0/22
  • Parent capacity1,024 addresses
  • Parent usable hosts1,022
  • Allocated addresses962
  • Remaining addresses62
  • Allocation efficiency93.9%
  • Subnet mask255.255.252.0
  • Wildcard mask0.0.3.255
Subnet allocations
SubnetNetworkCIDRMaskFirst IPLast IPBroadcastUsable hostsCopy row
Core10.20.0.0/23255.255.254.010.20.0.110.20.1.25410.20.1.255510
Engineering10.20.2.0/24255.255.255.010.20.2.110.20.2.25410.20.2.255254
Voice10.20.3.0/25255.255.255.12810.20.3.110.20.3.12610.20.3.127126
Guest Wi-Fi10.20.3.128/26255.255.255.19210.20.3.12910.20.3.19010.20.3.19162
WAN link10.20.3.192/31255.255.255.25410.20.3.19210.20.3.193—2

Unallocated address space

Unallocated ranges inside the parent network
StartEndCIDRAddresses
10.20.3.19410.20.3.255Not a single block62

Sizing check

  • Required addresses = usable hosts + 2, rounded up to the next power of two. Requests for 1 or 2 hosts are served by a /32 or /31, which reserve nothing.
  • Leftover addresses inside each block (22 in total) are wasted: a subnet cannot be sold back to the parent.
  • Largest first is why the blocks sit together with a single tail of free space.
  • Network and broadcast addresses are reserved for prefixes /30 and shorter, which is why each block is sized hosts + 2. /31 and /32 have neither.
  • The parent must be entered as its network address. If you paste an address with host bits, the message names the correct parent.
  • Efficiency is allocated addresses ÷ parent addresses. It counts the reserved pair and each block’s unused tail, not just the hosts you asked for.
  • Every requirement is allocated or the calculation stops with an error — nothing is silently dropped. Addresses are shown in decimal octets as typed, and host counts use this page's number format.

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.