Introduction
Variable Length Subnet Masking (VLSM) lets you split a network into subnets of different sizes. Instead of giving every subnet the same number of IP addresses, VLSM lets you assign only what each subnet actually needs. This saves IP addresses and makes your network more efficient.
Our VLSM Calculator does the math for you. Just enter your network address, subnet mask, and the number of hosts each subnet needs. The calculator will figure out the best way to divide your network. It gives you the subnet address, broadcast address, usable host range, and subnet mask for each subnet. This tool is helpful for students learning subnetting, network engineers planning new networks, and anyone studying for IT certifications like the CCNA. For standard equal-sized subnetting, you may also want to try our Subnet Calculator, and for broader CIDR block analysis, check out our CIDR Calculator.
How to use our VLSM Calculator
Enter your network address, subnet mask, and the number of hosts needed for each subnet. The calculator will divide your network into smaller subnets using Variable Length Subnet Masking (VLSM), giving you the most efficient use of IP addresses.
Network Address: Type in the starting IP address of your network. This is the base address you want to split into subnets. For example, 192.168.1.0.
Subnet Mask (CIDR): Enter the prefix length or subnet mask for your main network. This tells the calculator how big your total address space is. For example, /24 gives you 256 total addresses. If you need help determining the right CIDR block size for your network, our CIDR Calculator can assist.
Number of Subnets: Enter how many subnets you need to create from your network. Each subnet will be sized based on the number of hosts you assign to it.
Hosts per Subnet: For each subnet, enter the number of usable host addresses you need. List them in order. The calculator will sort them from largest to smallest and assign the right subnet size to each one automatically.
Once you click calculate, the tool will output each subnet's network address, broadcast address, usable host range, subnet mask, and CIDR notation. It will also show you how many addresses are wasted so you can see how efficient your design is.
What Is VLSM?
VLSM stands for Variable Length Subnet Masking. It is a method used in networking to divide a single network into smaller sub-networks (called subnets) of different sizes. Unlike fixed-length subnetting, where every subnet gets the same number of addresses, VLSM lets you assign exactly the right amount of address space each subnet needs. This means you waste fewer IP addresses and use your network more efficiently.
Why VLSM Matters
Every network has a limited number of IP addresses. If you use fixed subnetting, a department with 10 computers gets the same size subnet as one with 200 computers. That wastes a lot of addresses. With VLSM, you give the large department a big subnet and the small department a small one. This is especially important for organizations that need to manage their IPv4 address space carefully, since available IPv4 addresses are scarce. For a quick look at how fixed-length subnetting compares, try our Subnet Calculator.
How VLSM Works
VLSM follows a simple process:
- Start with a base network. This is your full block of IP addresses, written in CIDR notation (for example, 192.168.1.0/24, which gives you 256 total addresses). You can verify your base network details using our CIDR Calculator.
- List your subnets by size. Sort them from the one needing the most hosts down to the one needing the fewest. This is a best practice because larger blocks need to be aligned on specific address boundaries.
- Assign address blocks one at a time. For each subnet, pick the smallest possible prefix length (subnet mask) that can hold the required number of hosts. A subnet with 50 hosts, for example, needs a /26 block (64 total addresses, 62 usable). A subnet with 10 hosts needs a /28 block (16 total addresses, 14 usable).
- Move to the next available address and repeat until all subnets are allocated.
Key Terms to Know
- CIDR Notation: A shorthand way to write an IP address and its subnet mask together, like 192.168.1.0/24. The number after the slash is the prefix length, which tells you how many bits are used for the network part of the address.
- Subnet Mask: A 32-bit number that separates the network portion of an address from the host portion. For /24, the mask is 255.255.255.0. Our Subnet Calculator can help you convert between prefix lengths and subnet masks.
- Wildcard Mask: The inverse of the subnet mask. It is often used in router access control lists and routing protocols.
- Network Address: The first address in a subnet. It identifies the subnet itself and cannot be assigned to a device.
- Broadcast Address: The last address in a subnet. It is used to send data to all devices on that subnet and also cannot be assigned to a device.
- Usable Hosts: The total addresses in a subnet minus two (the network and broadcast addresses). For a /26 block with 64 total addresses, you get 62 usable host addresses.
A Quick Example
Say you have the network 192.168.1.0/24 (256 addresses) and four departments:
- Engineering: 50 hosts → needs a /26 (64 addresses)
- Sales: 30 hosts → needs a /26 (64 addresses)
- Management: 10 hosts → needs a /28 (16 addresses)
- IT: 5 hosts → needs a /29 (8 addresses)
Total allocated: 152 addresses out of 256. That leaves 104 addresses free for future growth. Without VLSM, using a single fixed subnet size large enough for 50 hosts would waste far more space on the smaller departments.
When to Use VLSM
VLSM is used in almost all modern networks. It is supported by routing protocols like OSPF, EIGRP, and BGP, which are called classless routing protocols because they carry subnet mask information in their updates. Older classful protocols like RIPv1 do not support VLSM. If you are designing a network, planning IP addresses, or studying for certifications like CCNA or CompTIA Network+, understanding VLSM is essential.