VLSM Calculator

The block you are dividing. Results update as you type.
Subnets and required hosts
Copied to clipboard

Sources

  1. Fuller, V. & Li, T. RFC 4632: Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan. IETF / RFC Editor, 2006.
  2. Pummill, T. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4. IETF / RFC Editor, 1995.
  3. Mogul, J. & Postel, J. RFC 950: Internet Standard Subnetting Procedure. IETF / RFC Editor, 1985.
  4. Retana, A., White, R., Fuller, V. & McPherson, D. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links. IETF / RFC Editor, 2000.

Formula

Prefix length for a subnet that must hold h usable hosts (classic accounting, network and broadcast reserved):$$ p = 32 – \left\lceil \log_2 (h + 2) \right\rceil $$Subnets are allocated largest-first. The allocation pointer starts at the network base and advances by each subnet's block size:$$ ptr_{k+1} = ptr_k + 2^{\,32 – p_k} $$Starting aligned and allocating in descending size order keeps every subnet on a valid boundary with no gaps.

Embed This Calculator

Copy the code and paste it into your website:

<!-- VLSM Calculator from CalculateQuick.com -->
<iframe src="https://calculatequick.com/embed/vlsm/" width="100%" height="600" style="border:none;" referrerpolicy="no-referrer-when-downgrade" title="VLSM Calculator"></iframe>
<p style="font-size:14px;text-align:center;margin-top:8px;"><a href="https://calculatequick.com/technology/vlsm-calculator/">VLSM Calculator</a> by <a href="https://calculatequick.com">CalculateQuick</a></p>

Tip: Adjust height="600" if needed.

WordPress

  1. Edit the page or post
  2. Add a “Custom HTML” block
  3. Paste the embed code
  4. Update/Publish

Wix

  1. Click Add (+) → Embed Code → Embed HTML
  2. Paste the code
  3. Publish

Squarespace

  1. Add a Code block
  2. Paste the code
  3. Save

Shopify

  1. Online Store → Pages → Show HTML
  2. Paste the code
  3. Save

Webflow

  1. Add an Embed element
  2. Paste the code
  3. Publish

HTML

  1. Paste into your HTML file
  2. Upload to server

Cite This Calculator

CalculateQuick. (2026). VLSM Calculator. Retrieved from https://calculatequick.com/technology/vlsm-calculator/
"VLSM Calculator." CalculateQuick, 2026, https://calculatequick.com/technology/vlsm-calculator/.
CalculateQuick. "VLSM Calculator." Accessed July 5, 2026. https://calculatequick.com/technology/vlsm-calculator/.

Share

Send Feedback

Found a bug? Have a suggestion? Let us know.

Thank you for your feedback!

Calculating a VLSM Plan From Host Counts

Enter the network you have been given, then list each subnet with a name and the number of hosts it must support. The plan recalculates as you type: every subnet gets the smallest block that fits its host count, allocated largest-first from the bottom of your network. The table shows each subnet’s network address, mask, usable range, and broadcast, and the bar above it shows how the whole block is carved up, including what is still free.

If the plan does not fit, the calculator says which subnet broke it, so you can shrink a host count, drop a subnet, or ask for a bigger block. Copy CSV exports the whole table for documentation, and Share Link produces a URL that reopens your exact plan, which makes it easy to send a proposed addressing scheme to a colleague.

Allocation Order and Alignment

Every subnet must start on a boundary divisible by its own size. Allocating the biggest subnets first keeps every allocation on a valid boundary: after a /25 placed at the bottom of a /24, the next address is a clean /26 boundary, then a /27 boundary, and so on. Allocated smallest-first, the large subnets need boundaries the earlier allocations already broke, which forces gaps and wastes space. The calculator sorts for you, then presents the results back in the order you listed them.

The sizing rule is the classic one used in networking courses and exams: a subnet needs the smallest power of two where the block size minus two covers the requested hosts, since the network and broadcast addresses are unusable. A request for 120 hosts gets a /25 (126 usable), 60 hosts gets a /26 (62 usable), and 2 hosts gets a /30. To see any allocated block down at the bit level, drop it into the IP subnet calculator.

Bar diagram of 192.168.10.0/24 divided by VLSM into a /25, /26, /27, and /30 with 28 addresses free, with block sizes and usable host counts

The block size steps are fixed, so every host count maps to exactly one prefix:

Hosts NeededPrefixUsableBlock Size
1 – 2/3024
3 – 6/2968
7 – 14/281416
15 – 30/273032
31 – 62/266264
63 – 126/25126128
127 – 254/24254256
255 – 510/23510512
511 – 1022/2210221,024
1023 – 2046/2120462,048
2047 – 4094/2040944,096

Reading the Spare Column

Spare is usable addresses minus requested hosts. Because blocks only come in power-of-two sizes, a 130-host request jumps from a /25 (126 usable, too small) to a /24 (254 usable), leaving 124 spare. That spare is growth headroom. If a department asks for 130 and will not grow, reducing the request to 126 saves half a /24. A spare of 1 or 2 is the opposite warning: any new device in that subnet forces a renumber.

Leftover Free Blocks

Whatever the plan does not use is listed as exact CIDR blocks, ready to allocate later. Record them in the documentation with the plan itself. Unrecorded free space is a common cause of overlapping subnets later. The free list uses the same exact-block math as the CIDR to IP range converter, so each chip is a real allocatable block, not an approximation.

Point-to-Point Links in a Plan

A router-to-router link needs exactly 2 usable addresses, which this calculator sizes as a /30, matching textbook and exam expectations. On modern equipment a /31 also works for point-to-point links and wastes nothing, so production networks often use /31s instead. If you plan with /31s, size the link rows as 2 hosts here, then halve those blocks when you configure.

Common VLSM Mistakes

Forgetting the two reserved addresses. A subnet for 30 hosts does not fit in a /27 minus nothing; a /27 holds exactly 30 usable of 32 addresses. A request for 31 needs a /26. The table above lists every jump point.

Allocating in listed order instead of size order. That works only when the list happens to be sorted already. When a small subnet lands first, alignment breaks and manually calculated plans start overlapping.

Counting interfaces instead of addresses. Every device interface, gateway, printer, access point, and management address in the subnet consumes one. Gateways are the most common omission: a 62-host request that did not count its gateway needs 63 addresses and no longer fits a /26.