Skip to content
gohacks.dev
DevOps

VLSM Subnet Calculator

Divide a network into variable-size subnets by the number of hosts each needs, allocating the largest first, with ranges, broadcast addresses and space used.

Free · No sign-up · Your inputs stay in your browser

Input

Split a network into subnets by size (VLSM)

Output

5 subnets, 48% of the space used

SubnetNeededCIDRUsable rangeUsableBroadcast
app servers20010.20.0.0/2410.20.0.1 - 10.20.0.25425410.20.0.255
k8s nodes12010.20.1.0/2510.20.1.1 - 10.20.1.12612610.20.1.127
databases5010.20.1.128/2610.20.1.129 - 10.20.1.1906210.20.1.191
vpn3010.20.1.192/2710.20.1.193 - 10.20.1.2223010.20.1.223
management1010.20.1.224/2810.20.1.225 - 10.20.1.2381410.20.1.239

Largest subnet first, each aligned to its own size, which is the order that wastes the least space. Two addresses per subnet are subtracted for the network and broadcast addresses; cloud providers reserve more (AWS keeps five per subnet), so leave headroom.

Runs in this browser. Nothing you paste is sent to a server.

Why largest first

Blocks must start on a multiple of their size. Allocating the big subnets first keeps alignment gaps out of the address space; allocating small ones first leaves fragments too small for the big ones. That is the standard VLSM procedure from network engineering courses, and it is also how to lay out a VPC.

Cloud subnets lose more

AWS reserves five addresses in every subnet (network, router, DNS, future use and broadcast), Azure five, and Google Cloud four. Size cloud subnets with that in mind, and leave room to grow: renumbering a subnet later means moving everything in it.

Share

Frequently asked questions

How many hosts fit in a /26?
64 addresses, 62 usable after the network and broadcast addresses, fewer in cloud subnets that reserve more.
Can subnets of different sizes share one network?
Yes, that is what VLSM means. Each subnet only needs its own aligned block, and routing uses the longest matching prefix.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools