IPv4 subnet calculatorNetwork, host range, broadcast, mask and wildcard for any IPv4 blockIPv6 subnet calculatorPrefix ranges, /64 counts, splits and a ULA prefix generatorVLSM calculatorSize subnets by host count, with AWS, Azure, GCP and OCI rulesVisual subnet plannerSplit and join blocks, label them, then share or export the planCIDR and IP range calculatorTurn any start and end address into the fewest CIDR blocksSupernet and route summarySummarise networks into one route or merge them exactlyWildcard mask calculatorACL wildcards, matched ranges and ready Cisco linesSubnetting practiceExam-style questions, checked instantly with the working shownSubnet mask cheat sheetEvery prefix from /0 to /32 with mask, wildcard and hostsIPv6 cheat sheetPrefix sizes, address types and the reserved rangesGuidesHow subnetting works, explained with worked examples

VLSM explained with a worked example

Variable length subnet masking gives each subnet the size it needs instead of cutting a network into equal pieces. Here is the method, a full worked example and the traps to avoid.

Updated Nov 20, 20268 min readFigures tested
Largest first, every block on its boundary192.168.10.0/24/25Office LAN/26Sales/27Guest/28Servers .0.128.255 244 of 256 usedfor 182 hosts across 5 subnets
Key facts
  • VLSM sizes each subnet by its own host count.
  • Always allocate the largest subnet first so every block stays aligned.
  • A block of N addresses must start on a multiple of N.
  • Leftover space splits into aligned free blocks you can use later.
VLSM calculator

Size subnets by host count, with AWS, Azure, GCP and OCI rules

Open the tool

Why equal subnets waste space

Say you have 192.168.10.0/24 and need five networks: an office LAN with 100 hosts, sales with 50, guest Wi-Fi with 20, servers with 10 and a WAN link with 2. Fixed-length subnetting has to use the largest size for all five. 100 hosts need a /25, and a /24 only holds two /25s. The plan fails before it starts.

With VLSM each subnet gets its own prefix. The office takes a /25, sales a /26, guest a /27, servers a /28 and the WAN link a /30. All five fit in the same /24 with space left over.

Step 1: size each subnet

Add 2 to each host count for the network and broadcast addresses, then round up to the next power of two.

SubnetHostsPlus 2BlockPrefixUsable
Office LAN100102128/25126
Sales505264/2662
Guest Wi-Fi202232/2730
Servers101216/2814
WAN link244/302
On a router-to-router link you can use a /31 instead of a /30 and save two addresses (RFC 3021). The calculator follows the classic /30 convention unless you size the link yourself.

Step 2: sort largest first

A block of 128 addresses must start on a multiple of 128, a block of 64 on a multiple of 64, and so on. If you place a small block first, the next large block can no longer start on its boundary and you lose space or create overlaps. Sorting by size, largest first, makes every placement land on a valid boundary automatically.

Step 3: place the blocks

Start at the bottom of the network and put each block right after the previous one.

SubnetNetworkFirst hostLast hostBroadcast
Office LAN192.168.10.0/25192.168.10.1192.168.10.126192.168.10.127
Sales192.168.10.128/26192.168.10.129192.168.10.190192.168.10.191
Guest Wi-Fi192.168.10.192/27192.168.10.193192.168.10.222192.168.10.223
Servers192.168.10.224/28192.168.10.225192.168.10.238192.168.10.239
WAN link192.168.10.240/30192.168.10.241192.168.10.242192.168.10.243

244 of the 256 addresses are now allocated. The remaining 12 addresses, 192.168.10.244 to .255, split into two aligned free blocks: 192.168.10.244/30 and 192.168.10.248/29. They are ready for another link or a small management VLAN. Open this exact plan in the VLSM calculator.

VLSM in the cloud

Cloud providers reserve more addresses than the classic two. AWS and Azure keep five per subnet, Google Cloud four and Oracle Cloud three, and each has a smallest allowed subnet. That changes the sizing step. 12 hosts fit a /28 on premises (14 usable) but not on AWS, where a /28 has only 11 usable addresses, so you need a /27. Our cloud reserved IP guide has the details, and the VLSM calculator applies them when you pick a platform.

Common VLSM mistakes

  • Allocating in the order you listed. Always sort by size first.
  • Forgetting growth. A subnet sized exactly to today's hosts fills up quickly. Round up a size when the spare count is small.
  • Leaving odd fragments. Free space should be kept as aligned blocks, not as a loose range, so it can be used later without renumbering.
  • Overlapping summaries. If you summarise routes, keep related subnets together so they share a common prefix. The supernet calculator shows what a summary covers.
How we check this page

Every figure on this site comes from the same calculation engine as the tools, and that engine is tested on each build against more than 6,600 cases generated by Python's standard ipaddress module. Rules are taken from the RFCs and vendor documents listed under Sources. Last reviewed November 20, 2026.

Sources

  1. RFC 1878: Variable Length Subnet Table For IPv4
  2. RFC 4632: Classless Inter-domain Routing (CIDR)
  3. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links