Network · Developer
VLSM calculator.
Enter a network block and how many hosts each subnet needs, one per line or separated by commas. The calculator sizes each subnet to the smallest prefix that fits, allocates the largest first so every block is aligned, and lists the network, mask, usable range and broadcast for each.
Inputs
Result
Enter a block and host counts, then press Calculate.
How VLSM allocation works
Variable-length subnet masking lets one block be carved into subnets of different sizes, which is the normal case under classless addressing (RFC 4632). Instead of giving every LAN the same size, each gets the smallest prefix that holds its hosts: a requirement of N hosts needs N + 2 addresses (network and broadcast), rounded up to a power of two. 50 hosts needs 52, rounded up to 64, which is a /26; 20 hosts needs 22, rounded to 32, a /27.
Allocating the biggest subnet first keeps every block aligned on its own size boundary and leaves the leftover space as one contiguous tail, so nothing overlaps and space is wasted as little as possible. If the requirements do not fit, the calculator says which one ran out of room. The sizing agrees with the variable-length subnet table in RFC 1878. For one fixed-size split instead, use the subnet calculator's "divide into" option.
Sources (retrieved 2026-10): RFC 4632 (classless inter-domain routing (CIDR)); RFC 1878 (variable length subnet table for IPv4); RFC 3021 (31-bit prefixes on IPv4 point-to-point links).
Frequently asked questions
What is VLSM?
Variable-length subnet masking: dividing one network into subnets with different prefix lengths so each is sized to its own host count rather than all being equal.
Why allocate the largest subnet first?
A subnet must start on a multiple of its own size. Placing the largest blocks first keeps all later blocks aligned and avoids gaps, so the plan fits whenever it can.
Why does 50 hosts need a /26?
50 hosts plus the network and broadcast addresses is 52 addresses. The next power of two is 64, which is a /26 (62 usable hosts).
What about point-to-point links?
A link with 2 hosts is sized as a /30 here (4 addresses, 2 usable). RFC 3021 allows a /31 on point-to-point links if your equipment supports it; use the subnet calculator to check a /31.
Pure arithmetic — no network access
This tool performs standard IPv4 subnet arithmetic entirely in your browser. It does not look anything up, and it doesn't check whether an address or subnet is actually routed, reachable, or assigned to anyone.