VLSM calculator
Fit subnets of different sizes into one block. List how many hosts each one needs, and get an aligned block for each, largest first.
Allocations
Example: type your own block and subnets above.
| Name | Needed | Subnet | Usable range | Usable | Wasted |
|---|---|---|---|---|---|
| London | 100 | 192.0.2.0/25 | 192.0.2.1 – 192.0.2.126 | 126 | 26 |
| Paris | 50 | 192.0.2.128/26 | 192.0.2.129 – 192.0.2.190 | 62 | 12 |
| Berlin | 25 | 192.0.2.192/27 | 192.0.2.193 – 192.0.2.222 | 30 | 5 |
| Madrid | 10 | 192.0.2.224/28 | 192.0.2.225 – 192.0.2.238 | 14 | 4 |
- Name
- London
- Needed
- 100
- Subnet
- 192.0.2.0/25
- Usable range
- 192.0.2.1 – 192.0.2.126
- Usable
- 126
- Wasted
- 26
- Name
- Paris
- Needed
- 50
- Subnet
- 192.0.2.128/26
- Usable range
- 192.0.2.129 – 192.0.2.190
- Usable
- 62
- Wasted
- 12
- Name
- Berlin
- Needed
- 25
- Subnet
- 192.0.2.192/27
- Usable range
- 192.0.2.193 – 192.0.2.222
- Usable
- 30
- Wasted
- 5
- Name
- Madrid
- Needed
- 10
- Subnet
- 192.0.2.224/28
- Usable range
- 192.0.2.225 – 192.0.2.238
- Usable
- 14
- Wasted
- 4
Space left over
1 block192.0.2.240/28
How it works
VLSM (variable-length subnet masking) lets one network hold subnets of different sizes. A sales floor with 50 devices gets a /26, a small team gets a /27, and a link between two routers gets a /30. Equal-sized subnets would waste most of the addresses.
Each subnet is a power of two in size. On IPv4 it needs room for its hosts plus two: the first address names the network and the last is the broadcast. So 50 hosts need 52 addresses, which rounds up to 64 (a /26). The wasted column counts the usable addresses that are left over.
The calculator places the biggest subnet first, then the next biggest, each at the next free address. Because the sizes shrink in powers of two, every subnet starts on a boundary of its own size, which is what routers require. What's left over is listed as CIDR blocks you can use later.
With the RFC 3021 option, a 2-host router link gets a /31 (no network or broadcast address) and a single host gets a /32. For equal subnets, use the subnet splitter. To check one subnet, use the subnet calculator.