VLSM Calculator

Enter a parent network and the number of hosts each subnet needs. The calculator places the blocks from the largest down and gives you a VLSM subnet plan.

The prefix length can be 0 to 30 (a /31 or /32 cannot be divided).
Hosts needed in each subnet (1 to 20 rows; the name is optional; empty rows are ignored)
Include any addresses used for a gateway in the hosts you enter.
When this is off, the smallest subnet is a /30 (2 hosts). When it is on, 1 host needed becomes a /32 and 2 hosts needed becomes a /31. A /31 is for a point-to-point link, and both addresses can be used for hosts (RFC 3021).
Parent network —

Totals
Total addresses in the parent network—
Total of the blocks requested—
Addresses allocated—
Addresses not allocated—
First unallocated address—
Utilization (allocated ÷ parent total)—

Blocks are placed from the start of the parent network, largest first (equal sizes in the order you entered them). This is the usual procedure, not a standard.

The text copied is the list of allocated networks (CIDR), one per line, in the order they were allocated.

What VLSM is

VLSM (variable length subnet masking) splits one parent network into subnets of different sizes. When subnets need different numbers of hosts, making them all the same size (the same prefix length) wastes addresses. Changing the prefix length to fit the hosts needed uses the addresses efficiently. A table of the number of addresses for each IPv4 prefix length is given in RFC 1878 (an informational document).

The allocation procedure (the usual one)

  1. Turn each request into the smallest block that has enough hosts. For /30 and shorter prefixes, usable hosts = total addresses − 2 (the network and broadcast addresses are not usable). For example, 100 hosts need a /25 (126 hosts) and 50 hosts need a /26 (62 hosts).
  2. Sort the blocks from the largest (most hosts) down. Blocks of the same size keep the order of the rows you entered.
  3. Place them one after another from the start of the parent network.

This is the common way of doing it and is not defined by a standard. CIDR blocks are powers of two in size (RFC 4632), and the start of each block is an address that is a multiple of the block size (a network boundary). Placing the largest first keeps the boundaries aligned (the tool also checks that they are).

When there are not enough addresses

/31 and /32

Example

Split the parent network 192.168.0.0/24 into four subnets of 100, 50, 25 and 10 hosts (with /31 and /32 off):

Order Hosts needed Allocation Usable addresses
1 100 192.168.0.0/25 192.168.0.1 to 192.168.0.126
2 50 192.168.0.128/26 192.168.0.129 to 192.168.0.190
3 25 192.168.0.192/27 192.168.0.193 to 192.168.0.222
4 10 192.168.0.224/28 192.168.0.225 to 192.168.0.238

The blocks total 128 + 64 + 32 + 16 = 240 addresses, and 16 addresses (from 192.168.0.240) are unallocated.

An example with a shortage: asking 192.168.0.0/24 for 126, 126 and 2 hosts needs two /25 blocks (128 addresses each), which fill the parent's 256 addresses, so the third request (2 hosts, a /30 of 4 addresses) cannot be allocated (4 addresses short).

Notes

Sources and checks

The RFC statements above were checked in the RFCs when the Japanese version of this tool was made (October 29, 2026): RFC 3021 (section 2.1, 31-bit prefixes on point-to-point links), RFC 4632 (CIDR; prefixes stand for power-of-two blocks) and RFC 1878 (an informational table of subnet sizes). They were not checked again for this page. The "largest first" procedure is not defined by an RFC; it is the usual practice.

Frequently asked questions

What is VLSM?

A way of splitting one parent network into subnets of different sizes to fit the number of hosts each one needs.

Why allocate the largest first?

Placing the biggest blocks first keeps the start of every block on a network boundary (a multiple of the block size) and leaves few gaps. This is common practice, not a standard.

Can I use a /31 on a LAN?

RFC 3021 describes the use on point-to-point links. It does not specify use as a LAN subnet.

What happens if there are not enough addresses?

The tool compares the total of the blocks with the parent network, shows how many addresses are missing, and lists the rows that could not be allocated, with the reason.