VLSM Subnet Calculator
Allocate IPv4 subnets from strict host requirements with exact capacity totals
Enter a source network and host counts to allocate.
About this tool
VLSM Subnet Calculator allocates variable-length IPv4 subnets inside one normalized parent CIDR. Enter one positive decimal host requirement per line; every nonempty line is validated before any allocation is returned. Requirements are sorted largest-first, while each row keeps its original input line. Under the traditional model, each subnet reserves network and broadcast addresses and uses the smallest fitting power-of-two block, with /30 as the minimum even for one or two hosts. BigInt keeps /1 and /0 capacities exact. If the complete plan does not fit, the error states the required and available address totals and returns no partial plan. Calculation runs only on request; editing clears the previous result. Cloud-specific reservations and IPv6 planning use other models.
Production Snippets
Host demand and allocated addresses are different totals
text
Parent: 192.0.2.0/24
Required hosts: 50, 25, 12, 5 (enter one per line)
50 β 192.0.2.0/26 : 64 addresses, 62 traditional hosts
25 β 192.0.2.64/27 : 32 addresses, 30 traditional hosts
12 β 192.0.2.96/28 : 16 addresses, 14 traditional hosts
5 β 192.0.2.112/29 : 8 addresses, 6 traditional hosts
Allocated: 120 of 256 addresses; remaining: 136.
This model reserves network and broadcast in every child.Frequently Asked Questions
How is a block selected for 50 hosts?
The smallest block whose traditional usable capacity meets 50 is /26: 64 total addresses minus network and broadcast leaves 62. A demand of 25 uses /27 with 30 usable addresses.
Why do one or two hosts still receive /30?
This calculator consistently reserves two addresses per subnet and uses /30 as its smallest block. It does not switch automatically to RFC 3021 /31 point-to-point or /32 host-route semantics.
Are invalid requirements skipped or rounded?
No. Each nonempty line must contain one positive decimal integer without signs, fractions, suffixes or leading zeros. The error identifies its input line. Limits are 256 requirements and 64 KiB of list text.
Can it calculate a /0 allocation without overflow?
Yes. A requirement of 4294967294 hosts uses 0.0.0.0/0 with 4294967296 total addresses and 4294967294 traditionally usable addresses. Larger single requirements are rejected.
What happens when the complete plan is too large?
The tool sums the rounded block sizes first. For two demands of 2 and 1 inside a /30, the plan needs 8 addresses but the parent has 4. It reports both totals and returns no partial rows.
Does the usable range guarantee every address can be assigned?
No. It reflects the traditional IPv4 network/broadcast model. Cloud reservations, gateways, interface capabilities and local policy may reserve more. Inputs stay local and no network is queried.
Keep browsing