VLSM calculator

What is a Vlsm Calculator?

Variable Length Subnet Masking (VLSM) divides an IP network into subnets of different sizes, each sized to the number of hosts it needs. Compared with fixed-size subnetting, it wastes far fewer addresses, which matters with scarce IPv4 space and when planning cloud VPCs, branch offices and point-to-point links. This calculator does the allocation for you.

How to use it

  1. Enter the base network in CIDR notation, for example 192.168.10.0/24.
  2. Add each subnet with its name and the number of hosts it needs.
  3. Read the allocated subnets with network address, prefix, mask, usable host range and broadcast address.

The method

  1. Sort the requirements from largest to smallest.
  2. For each, choose the smallest block whose usable hosts (2^host bits - 2) is enough.
  3. Allocate blocks one after another from the start of the base network, so every block is aligned to its size.

Worked example

Base 192.168.10.0/24; needs: Sales 100 hosts, Engineering 50, Guests 20, and a router link with 2 hosts.

  • Sales: /25, 126 usable, 192.168.10.0/25 (hosts .1 to .126, broadcast .127)
  • Engineering: /26, 62 usable, 192.168.10.128/26 (.129 to .190)
  • Guests: /27, 30 usable, 192.168.10.192/27 (.193 to .222)
  • Router link: /30, 2 usable, 192.168.10.224/30 (.225 to .226)

Addresses 192.168.10.228 to .255 remain free for growth.

Tips

  • Plan for growth; doubling a subnet later usually means renumbering.
  • Cloud providers reserve extra addresses: AWS reserves 5 per subnet.
  • /31 can be used for point-to-point links (RFC 3021) to save addresses.

Frequently Asked Questions

What is VLSM?

Variable Length Subnet Masking: dividing a network into subnets of different sizes based on how many hosts each needs.

Why allocate the largest subnets first?

Larger blocks must start on larger boundaries. Allocating them first keeps every block aligned and avoids gaps.

How many usable hosts are in a /26?

64 addresses minus the network and broadcast addresses, so 62 usable hosts.

Do cloud subnets have the same usable count?

No. Providers reserve extra addresses. AWS, for example, reserves five addresses in every subnet.