Networking Fundamentals

VLAN Calculator — Plan Subnets and Generate Cisco Config

G Gurpreet Singh July 28, 2026 5 min read
A Layer 3 switch with colour-coded VLAN ports beside the resulting /26 subnet allocation for each VLAN
1 Choose the address space


Aligned down automatically if it is off-boundary


Match this to the device count per segment

2 Add your VLANs


3 Generate the plan


VLAN addressing plan
Cisco IOS, Layer 3 switch

How to Use This VLAN Calculator

  1. Enter your base network. This is the first address of the range you want to carve up, typically 192.168.0.0, 10.0.0.0 or 172.16.0.0. If the address you type is not on a clean subnet boundary, the calculator aligns it down for you and tells you what it used.
  2. Pick the subnet size. A /24 gives every VLAN 254 usable hosts, which is the normal choice for office LANs. Use /27 or /28 for small segments like a printer or camera VLAN so you are not wasting a full /24 on six devices.
  3. Add your VLANs. Give each one a department name and a VLAN ID between 1 and 4094. Leave the ID blank and the calculator continues the numbering for you in steps of 10.
  4. Generate the plan. You get a table with the network, gateway, broadcast address and usable host count for each VLAN, plus a Cisco IOS configuration you can copy straight into a Layer 3 switch.

How VLAN Subnetting Works

Every VLAN needs its own IP subnet. The subnet size decides how many addresses each VLAN gets, and those blocks have to line up on clean boundaries or the switch will reject the configuration.

Take a base network of 192.168.0.0 with a /26 subnet per VLAN. A /26 is 64 addresses, so each VLAN starts 64 addresses after the previous one:

VLANNetworkGatewayBroadcastUsable hosts
10192.168.0.0/26192.168.0.1192.168.0.6362
20192.168.0.64/26192.168.0.65192.168.0.12762
30192.168.0.128/26192.168.0.129192.168.0.19162
40192.168.0.192/26192.168.0.193192.168.0.25562

Two addresses in every block are unusable: the first is the network address itself and the last is the broadcast address. That is why a /26 with 64 addresses only gives you 62 usable hosts. The gateway is conventionally the first usable address, which is what this calculator assigns.

Common VLAN ID Ranges

RangeTypeNotes
0, 4095ReservedCannot be used, reserved by the 802.1Q standard.
1Default VLANEvery Cisco switch port starts here. Do not use it for user traffic.
2 to 1001Normal rangeStored in vlan.dat and carried by VTP versions 1 and 2.
1002 to 1005ReservedLegacy Token Ring and FDDI VLANs.
1006 to 4094Extended rangeRequires VTP transparent mode on VTP v1/v2, or VTP version 3.

VLAN Best Practices

  • Separate sensitive traffic. Management interfaces, security cameras and IoT devices belong on their own VLANs, away from user traffic.
  • Do not use VLAN 1. It is the default on every Cisco switch and a well-known attack target. Move management to a dedicated VLAN and change the native VLAN on your trunks.
  • Leave gaps in your numbering. Using 10, 20, 30 instead of 1, 2, 3 means you can insert a VLAN later without renumbering everything.
  • Match the subnet to the device count. A /24 for a VLAN with eight printers wastes 246 addresses and makes broadcast domains larger than they need to be.
  • Document the VLAN database. Record which VLAN serves which purpose, which subnet it uses, and which ports belong to it. Future you will need it during an outage.
  • Prune unused VLANs from trunks. Only allow the VLANs that actually need to cross a trunk link, it reduces broadcast traffic and limits the blast radius of a loop.

Frequently Asked Questions

How many VLANs can a switch support?

The 802.1Q standard allows VLAN IDs 1 through 4094, so 4094 VLANs in theory. In practice the limit is your switch model, many access switches support 255 or 1024 active VLANs at once, so check the datasheet before planning a large deployment.

Does every VLAN need its own subnet?

Yes. A VLAN is a separate broadcast domain, and devices in different broadcast domains cannot reach each other at Layer 2. Giving two VLANs the same subnet means traffic between them has to be routed to an address that appears to be local, which breaks. See our guide on VLAN vs subnet for the full explanation.

What subnet size should I choose per VLAN?

Count the devices in the segment and add room for growth, then pick the smallest block that fits. A /24 (254 hosts) suits a general office VLAN. A /27 (30 hosts) or /28 (14 hosts) is right for printers, cameras or a small server segment. Oversized subnets create unnecessarily large broadcast domains.

Why is the gateway always the first usable address?

It is a convention, not a rule, you could equally use the last usable address. What matters is that you pick one convention and apply it everywhere, so anyone troubleshooting the network knows where to look.

What is the difference between the network address and the gateway?

The network address is the first address in the block and identifies the subnet itself; it cannot be assigned to a device. The gateway is a real, assignable address on the router or Layer 3 switch that hosts use to reach other subnets.

Can I use this config on a Layer 2 switch?

The vlan and name commands work on any Cisco switch. The interface Vlan sections with IP addresses require a Layer 3 switch or a router, on a Layer 2 switch the gateway lives on the upstream router instead.

Do VLAN IDs have to match between switches?

Yes. A VLAN ID is carried in the 802.1Q tag on trunk links, so VLAN 20 on one switch must be VLAN 20 on every other switch in the same Layer 2 domain. VTP can propagate the VLAN database automatically, but the IDs themselves must stay consistent.

Related Guides and Tools

Learn more about VLANs in our detailed guides: What is a VLAN?, VTP, VLAN Trunking Protocol, Access Port vs Trunk Port, and VLAN vs Subnet. For pure subnetting work, use our free subnet calculator, and to see how addresses break down in binary try the IP to binary converter. Browse all our free networking tools.

GU
Written by

Gurpreet Singh

Hey! I"m Gurpreet Singh and I Have 7+ Years of experience in the Network & Security Domain as well as the Cloud Infra Domain. I am Certified with Cisco ( CCNA ), CheckPoint ( CCSA ), 1xAWS, 3xAZURE, and 3xNSE. So I love to share my tech knowledge with you.

Leave a Reply

Your email address will not be published. Required fields are marked *