VLSM calculator
Right-size every subnet. Enter a base network and how many hosts each subnet needs, and this tool allocates variable-length subnets — network, mask, usable range, and broadcast for each — largest-first, the way the CCNA teaches it. No account, nothing to install.
| Subnet | Needed | Network | Mask | Usable range | Broadcast | Hosts |
|---|---|---|---|---|---|---|
| Sales | 50 | 192.168.1.0/26 | 255.255.255.192 | 192.168.1.1 – 192.168.1.62 | 192.168.1.63 | 62 |
| Engineering | 25 | 192.168.1.64/27 | 255.255.255.224 | 192.168.1.65 – 192.168.1.94 | 192.168.1.95 | 30 |
| Management | 10 | 192.168.1.96/28 | 255.255.255.240 | 192.168.1.97 – 192.168.1.110 | 192.168.1.111 | 14 |
| WAN link | 2 | 192.168.1.112/30 | 255.255.255.252 | 192.168.1.113 – 192.168.1.114 | 192.168.1.115 | 2 |
Allocated largest-first from 192.168.1.0/24. Used 116 of 256 addresses · 140 left.
The VLSM method in four steps
- List your requirements — how many usable hosts each subnet needs (a 50-host LAN, a 2-host WAN link, and so on).
- Sort biggest first — always allocate the largest subnet before the smaller ones so every block lands on a valid boundary.
- Pick the smallest mask that fits — for each requirement, use the smallest block whose usable count (2^host-bits − 2) covers it.
- Hand out the next block — start the next subnet where the last one ended, and repeat until every requirement is placed.
VLSM calculator FAQ
What is VLSM?
VLSM (Variable Length Subnet Masking) means using different subnet masks inside the same network so each subnet is sized to what it actually needs. Instead of wasting a /24 on a link that needs two addresses, you give a 50-host LAN a /26 and a point-to-point WAN link a /30. It conserves address space and is a core CCNA skill.
How does this calculator allocate the subnets?
It sorts your requirements largest-first, then for each one picks the smallest block whose usable host count (2^host-bits − 2) covers the requirement, and hands out the next available aligned block. Allocating largest-first from an aligned base is the standard VLSM method — it guarantees the blocks line up on their boundaries and never overlap.
Why must I subnet the biggest requirement first?
Because each subnet must start on a boundary that is a multiple of its own block size. If you allocate the largest blocks first from an aligned starting point, every later (smaller) block automatically lands on a valid boundary. Do it out of order and you can strand address space or create overlaps.
What if my subnets don't fit?
The calculator flags any subnet that runs past the end of the base block and tells you how many addresses are left. Fix it by choosing a larger base block (a smaller prefix, e.g. /23 instead of /24) or by trimming the host requirements.
More free tools
Subnet Calculator →
Enter an IPv4 address and prefix — get the network, broadcast, host range, masks, and host count instantly.
Subnetting Practice →
Random CCNA-style subnetting questions, graded the instant you answer, with a streak counter.
Well-Known Ports →
A searchable TCP/UDP port reference — SSH 22, DNS 53, HTTPS 443 — plus a quiz to drill them.
OSI Model Quiz →
A protocol or device appears; you pick the right OSI layer. Instant feedback and a streak.
Try the Grader →
Edit a real Cisco IOS config in your browser and get instant per-requirement pass/fail.
Make the subnetting automatic
A calculator checks your work; drilling it by hand is what passes the exam. Practice, then build it in a lab.