Subnet & VLSM Calculator

Enter a network and either a simple prefix, or a list of host requirements for a VLSM split. Everything runs in your browser — nothing is sent anywhere.

255.255.252.0
VLSM split by requirement

How subnetting works

An IPv4 address is 32 bits long. A subnet mask (or its shorthand, the CIDR prefix like /24) marks how many of those bits identify the network, leaving the rest to identify individual hosts within it. A /24 network uses 24 bits for the network portion and 8 bits for hosts, giving 256 total addresses — 254 of which are usable once you subtract the network address and the broadcast address.

The smaller the prefix number, the larger the block: a /22 is four times the size of a /24, covering 1,024 addresses instead of 256. Moving in the other direction, each additional bit you borrow for the network portion halves the number of available host addresses.

When to use VLSM

A flat subnet mask gives every segment of your network the same number of addresses, which usually means wasting a lot of space. A management VLAN with six switches doesn't need the same 254-address block as an office LAN with 200 people on it. VLSM (Variable Length Subnet Masking) solves this by sizing each subnet to what it actually needs — largest segments first — so the same base network can serve more purposes without wasting address space or needing a larger allocation than necessary.

Frequently asked questions

How do I calculate the usable hosts in a subnet?

Take the total number of addresses in the block (2³² minus the prefix length) and subtract 2 for the network and broadcast addresses. A /24 has 256 total addresses and 254 usable hosts.

What is VLSM and why use it instead of a flat subnet mask?

VLSM lets you split one network into subnets of different sizes based on what each segment actually needs, instead of giving every segment the same fixed-size block — avoiding wasted address space on small segments.

Why is my subnet's first usable address .1 and not .0?

The first address in a subnet is the network address, which identifies the subnet itself rather than a host, so the first assignable host address is always one higher.