Allocate variable-length subnets efficiently across a network based on per-subnet host requirements.
VLSM (Variable Length Subnet Masking) subdivides a network into subnets of different sizes instead of one fixed size for all, so each subnet uses only as many addresses as it needs. The standard approach sorts requirements largest-first, then for each requirement finds the smallest block (highest prefix) whose usable host count (2^(32−prefix) − 2) still meets the need, allocating sequentially from the base network to avoid overlap.
Smallest fitting block
Find smallest prefix p where 2^(32−p) − 2 ≥ hosts needed
Allocating the biggest subnets first prevents small subnets from fragmenting the address space in a way that leaves no contiguous block large enough for a later, bigger requirement.
For each host requirement, the calculator picks the smallest block (i.e., the highest CIDR prefix) whose usable host count is still greater than or equal to what's needed — this minimizes wasted addresses.
The calculator allocates as many subnets as fit and reports that the base network needs to be larger (use a smaller prefix number, e.g. /22 instead of /24) to fit every requirement.
Yes. Fixed-Length Subnet Masking splits a network into equal-sized subnets regardless of actual need, wasting addresses on small subnets. VLSM tailors each subnet's size to its requirement, conserving address space.