%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

VLSM Subnet Planner

Results update as you type.

Your numbers

Understanding the VLSM subnet planner — concept and principle

VLSM (variable-length subnet masking) means splitting one address block into subnets of different sizes, each sized to its own need, instead of cutting it into equal pieces. The planner takes a base network and a list of required host counts and returns a non-overlapping network address and prefix for each subnet. It is used when designing office, branch or lab networks where a user LAN needs 100 addresses but a router-to-router link needs only 2.

VLSM plan inside 10.0.0.0/24100, 50, 20 and 2 hosts get /25, /26, /27 and /30 blocks at .0, .128, .192 and .224; .228 to .255 stay free.Biggest first, smallest block that fits/25/26/27/30free.0.128.192.224hosts + 2 → next power of 2100 + 2 = 102 → 12810.0.0.0/2550 + 2 = 52 → 6410.0.0.128/2620 + 2 = 22 → 3210.0.0.192/272 + 2 = 4 → 410.0.0.224/30
Each request gets the smallest power-of-two block that holds its hosts plus network and broadcast.

How it is calculated

  1. Sort the requests from largest to smallest.
  2. For each request h, find the smallest number of host bits b with 2^b ≥ h + 2 (two extra addresses for network and broadcast): b = ⌈log2(h + 2)⌉. The prefix is 32 − b and the block size is 2^b.
  3. Round the current address up to the next multiple of the block size so the subnet is aligned.
  4. Assign that block, then move the pointer past it and continue.

Results are labelled with the original request number (#1, #2 …) so you can match them to your list.

The principle

A subnet of size 2^b must start on an address divisible by 2^b, otherwise its mask would cut through the middle. Placing the biggest blocks first keeps every later, smaller block naturally aligned and leaves no gaps, which is why largest-first is the standard VLSM method. Using the smallest prefix that fits each request avoids wasting addresses on oversized subnets.

Worked example

  1. Base 10.0.0.0, requests 100, 50, 20 and 2 hosts (already in descending order).
  2. 100 + 2 = 102 → 2^7 = 128, so /25. Assigned 10.0.0.0/25 (10.0.0.0–10.0.0.127).
  3. 50 + 2 = 52 → 2^6 = 64, so /26. Next aligned start is 10.0.0.128: 10.0.0.128/26.
  4. 20 + 2 = 22 → 2^5 = 32, so /27 at 10.0.0.192/27.
  5. 2 + 2 = 4 → 2^2 = 4, so /30 at 10.0.0.224/30.
  6. The plan uses 10.0.0.0 to 10.0.0.227; the rest of 10.0.0.0/24 is free for growth.

How to read the result

Each line gives the network address and prefix; usable hosts are 2^(32 − prefix) − 2, so a /25 holds 126, a /26 62, a /27 30 and a /30 2. Spare capacity inside each subnet is the difference from your request. Check that the last subnet still lies inside the block you actually own.

Common mistakes

Keep in mind: The planner does not know the size of your base block, so it will not warn you if the plan runs past it. Confirm the final address against your allocation and test any production change carefully.

Frequently asked questions

Why is the largest subnet allocated first?

Large blocks have the strictest alignment; placing them first lets smaller ones fill the remaining space without gaps.

What prefix fits 30 hosts?

A /27, which provides exactly 30 usable addresses.

Should point-to-point links use /30 or /31?

Both work. /30 is universal; /31 saves addresses where both devices support RFC 3021.

Sources: IETF RFC 1878, Variable Length Subnet Table for IPv4 · IETF RFC 4632, Classless Inter-domain Routing (CIDR)

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →