IP Subnet Calculator & VLAN Planner
Last reviewed: by Sarwar Islam
Check any IPv4 subnet in seconds, then carve one address block into right-sized VLANs for CCTV, access control, BMS and the other ELV systems on a project. The worked 5-VLAN plan and the sizing rules below the tool show how each prefix, gateway and free block is worked out.
IP Subnet & VLAN Planner
Subnet calculator plus a VLSM planner that carves CCTV, access control, BMS and other ELV VLANs from one block.
💾 Save stores the current inputs under this name in this browser (localStorage). Saved projects:
IPv4 address
Accepts 192.168.10.37/24, 192.168.10.37/255.255.255.0 or 192.168.10.37 255.255.255.0.
Drag to try other subnet sizes for the same address.
32-bit binary view
Subnet details
Base network
Design hosts = ⌈required × (1 + growth)⌉, + 1 when the gateway is counted. Blocks are /30 or larger and allocated largest first on their natural boundary.
VLANs
Quick-add an ELV preset (typical starting sizes, edit to suit):
Address-space map
VLAN addressing plan
Inputs
📘 Worked example
🎓 How to use this tool
- Subnet calculator: type an address with its prefix, e.g.
192.168.10.37/24, or an address and a dotted mask. Results update as you type. - Read the KPI tiles and the details table for the network, broadcast, first and last usable host, mask and wildcard. The binary strip shows which bits are network (blue) and which are host (green).
- Use the prefix slider to see how many hosts a /23, /25 or /27 gives for the same address.
- VLAN planner: enter the base block the client or IT team has given you, e.g.
10.20.0.0/22, and a growth allowance (30% is a sensible ELV default). - Add one row per VLAN with its name, VLAN ID (1–4094) and the number of devices today, or tap a preset such as CCTV cameras or BMS and edit it.
- Check the verdict, the address-space map and the plan table. Red means a VLAN does not fit: enlarge the base block, reduce growth or split the system.
- Export the plan as CSV for the IP schedule, or press MikroTik script (RouterOS 7) to turn it into a bridge VLAN filtering script you can review, copy or download as .rsc. Save the project in your browser, or print it to PDF for the submittal.
Tips & common mistakes
- Count every IP device, not just cameras: NVRs, encoders, PoE switches' management, door controllers, readers on IP, workstations and video wall controllers.
- Gateways, HSRP/VRRP virtual IPs and DHCP servers use addresses too. Reserve them (tick “count the gateway”) and add extra hosts for a redundant pair.
- Don't put ELV devices on VLAN 1 (the default VLAN). Keep management on its own VLAN and restrict it with ACLs.
- Very large flat VLANs (more than about 500 hosts, typical) increase broadcast and multicast load; split big CCTV systems by building or floor.
- /31 is only for point-to-point router links (RFC 3021) and /32 is a single host route; neither is a usable VLAN subnet.
Standards & assumptions
IPv4 subnetting per RFC 950 and CIDR per RFC 4632; private ranges per RFC 1918; shared address space RFC 6598; /31 point-to-point per RFC 3021; VLAN IDs per IEEE 802.1Q (1–4094). Preset host counts are typical starting values only. The result is for guidance and must be verified against the manufacturer's data, the client's IT addressing policy and local code.
To download and print this tool without a watermark, please log in and request approval.
An IP plan the IT department will accept
On most building projects the ELV contractor does not own the network. The IT team hands over a block such as 10.20.0.0/22 and expects a plan back: which VLAN carries the cameras, which carries the door controllers, what the gateways are and how much room is left. A wrong plan shows up late, usually when the 181st camera will not take an address. This tool has two tabs. The subnet calculator answers “what is this address and mask?” and the VLSM / VLAN planner answers “how do I split this block?”. It is for ELV engineers preparing an addressing submittal, installers setting static IPs, and students who want to see the binary behind the answer.
Step by step
Subnet calculator
- Type an address with its prefix or mask, for example 192.168.10.37/24 or 192.168.10.37 255.255.255.0.
- Drag the prefix slider to see how the same address behaves in a larger or smaller subnet.
- Read the network, broadcast, first and last usable host, wildcard mask, scope (private RFC 1918 or public) and the 32-bit binary view.
VLSM / VLAN planner
- Enter the base block the network owner gave you and a growth allowance in percent.
- Choose the gateway position: First usable (network + 1) or Last usable (broadcast − 1), and decide whether the gateway (SVI) is counted as one of the hosts.
- Add each VLAN with its name, VLAN ID and device count, or start from the ELV presets and edit the numbers.
- Check the address-space map and the addressing plan, then export the plan as CSV for the submittal or commissioning sheet.
Worked example: five ELV VLANs in a /22
A mid-size site has 180 IP cameras, 10 NVRs and servers, 40 access control devices, 25 BMS controllers and 20 managed switches and UPS cards. The client’s IT team allocates 10.20.0.0/22. We allow 30 % growth, put the gateway on the first usable address and count it as a host. “▶ Load demo” fills in exactly these values.
| VLAN | Hosts | Design hosts | Subnet | Gateway | Broadcast | Utilisation |
|---|---|---|---|---|---|---|
| 10 CCTV | 180 | 235 | 10.20.0.0/24 | 10.20.0.1 | 10.20.0.255 | 92.5 % |
| 30 Access Control | 40 | 53 | 10.20.1.0/26 | 10.20.1.1 | 10.20.1.63 | 85.5 % |
| 40 BMS | 25 | 34 | 10.20.1.64/26 | 10.20.1.65 | 10.20.1.127 | 54.8 % |
| 99 Management | 20 | 27 | 10.20.1.128/27 | 10.20.1.129 | 10.20.1.159 | 90.0 % |
| 20 NVR/Servers | 10 | 14 | 10.20.1.160/28 | 10.20.1.161 | 10.20.1.175 | 100.0 % |
All five VLANs fit: 432 of the 1,024 addresses are allocated (42.2 %) and 592 stay free as 10.20.1.176/28, 10.20.1.192/26 and 10.20.2.0/23. The /23 is the useful one: it can take a future Wi-Fi or IP phone VLAN without renumbering anything. The NVR/Servers VLAN shows 100 % because its growth allowance fills the /28 exactly; if the server count is uncertain, raise it now. Switch the gateway option to Last usable and the CCTV gateway becomes 10.20.0.254 while every subnet stays the same.
How the numbers are worked out
- Network = IP AND mask; broadcast = network OR wildcard, where the wildcard is the inverted mask.
- Usable hosts = 2^(32 − prefix) − 2 for /30 and larger blocks. A /24 gives 254, a /26 gives 62.
- Design hosts = ⌈required × (1 + growth)⌉, plus 1 when the gateway is counted. For CCTV: ⌈180 × 1.3⌉ + 1 = 235, so the smallest block that holds it is a /24.
- Blocks are placed largest first, each on a multiple of its own size, which is why the /26s start at .0 and .64 and never straddle a boundary.
- /31 is handled as a point-to-point link per RFC 3021: the calculator shows two usable addresses and no broadcast. /32 is a single host route. The planner itself only allocates /30 or larger, because a VLAN with devices needs a broadcast domain.
Design tips and common mistakes
- Keep each security system on its own VLAN and route between them only through firewall or ACL rules. The VLAN guide for CCTV systems covers the switch side.
- Avoid one huge flat camera VLAN. Above roughly 500 hosts, split by building or floor.
- Agree the gateway convention with IT before you program a single camera. Mixing .1 and .254 across VLANs causes avoidable commissioning faults.
- Reserve the management VLAN for switches, UPS cards and controllers, and keep it off user ports. See CCTV cybersecurity for hardening steps.
Export a MikroTik RouterOS 7 script
When the router or switch on site is a MikroTik, the plan does not have to be typed in again. Press MikroTik script (RouterOS 7) under the addressing plan, enter the bridge name and the trunk or uplink ports, add the access ports of each VLAN if you want them, then choose whether this router is the gateway, which VLAN is for management and which VLANs get a DHCP server.
The tool writes a bridge VLAN filtering script in a safe order. The bridge is created with VLAN filtering off, the ports are added with their PVID and frame types, each VLAN gets its own entry in the bridge VLAN table, and then come the VLAN interfaces, the gateway addresses and, where ticked, an address pool, DHCP server and DHCP network per VLAN. VLAN filtering is switched on only in the last line, so a typing mistake earlier in the script does not cut you off half way. Duplicate VLAN IDs, overlapping subnets, VLAN 1 and invalid interface names are refused before anything is generated, and VLAN names are cleaned before they go into comments.
Copy the script or download it as an .rsc file, read it line by line, take a backup and run it in Safe Mode. It does not write firewall, NAT or routing rules. The MikroTik VLAN configuration guide covers those, with the matching WinBox steps.
What the tool does not do
It plans IPv4 only. It does not check the block against addresses already in use, and it does not write firewall, NAT or routing rules: the MikroTik export covers the bridge, VLANs, gateway addresses and optional DHCP scopes only. VLAN IDs are checked for duplicates but not against the client’s existing list. Treat the CSV and the script as a proposal for the network owner to approve.
Standards notes
The arithmetic follows IPv4 subnetting as described in RFC 950 and CIDR in RFC 4632; RFC 1918 defines the private ranges, RFC 6598 the shared address space and RFC 3021 the /31 point-to-point case. IEEE 802.1Q gives VLAN IDs 1–4094. These documents give guidance; the client’s IT policy and any local or sector security rules decide what is allowed on site.
Frequently asked questions
How many usable hosts does a /24 have?
254. The network address (.0) and the broadcast (.255) cannot be given to devices, and the gateway takes one of the 254.
Should the gateway be the first or the last usable address?
Either works technically. Follow the client’s convention; the tool offers network + 1 and broadcast − 1 so the plan matches it.
Why does a 50-camera VLAN get a /25 and not a /26?
With 30 % growth and the gateway counted, 50 cameras become 66 design hosts. A /26 holds only 62, so the planner moves up to a /25 with 126 usable. If that wastes too much space, lower the growth figure for that VLAN only after agreeing it with the client.
Can I use a /31 for a camera VLAN?
No. A /31 is only for a link between two routers (RFC 3021). Any VLAN with end devices needs at least a /30, and realistically much more.
For the bandwidth that goes with the plan, see the Network CCTV Designer.
Watch the tutorial

IP Subnet & VLAN Planner: step-by-step tutorial · More on YouTube @techubox

