IPv4 Subnet & VLSM Planner
Fit multiple networks into one IPv4 parent block. Compare entered order with largest-first allocation, protect existing reservations, and see which requests fit and which remain unplaced. A proportional address-space map, block-level zoom and complete request ledger make fragmentation visible instead of hiding it behind a total free-address count.
Make room for every network
Compare allocation order, protect reserved blocks, and explore exactly where your IPv4 address space goes.
Illustrative planning only. Include gateways in requested host counts. No router configuration, address ownership or routability validation.
Dotted-decimal address / prefix 0–32. Host bits are normalized explicitly in the result.
Reserved blocks
Up to 32 aligned, nonoverlapping CIDRs inside the parent.
Requested subnets
Up to 64 requests. Entered order is compared with largest-first. Changing kind preserves the host draft for you to correct.
Parent network: 192.168.10.0/24
192.168.10.0 through 192.168.10.255 · 256 addresses
Address-space map
Viewing 192.168.10.0/24 · 256 addresses. Largest available block in the whole parent: /28 (16 addresses).
Solid = allocated · diagonal stripes = reserved · dots = free. Widths are proportional to addresses. Tiny blocks may be invisible; select Zoom in the block table to inspect them.
| Type / name | Full CIDR | Visible / full addresses | Inspect |
|---|---|---|---|
| allocated: Staff | 192.168.10.0/25 | 128 / 128 | |
| allocated: Guests | 192.168.10.128/26 | 64 / 64 | |
| allocated: Devices | 192.168.10.192/27 | 32 / 32 | |
| allocated: Router link | 192.168.10.224/31 | 2 / 2 | |
| allocated: Loopback | 192.168.10.226/32 | 1 / 1 | |
| free: Unallocated | 192.168.10.227/32 | 1 / 1 | |
| free: Unallocated | 192.168.10.228/30 | 4 / 4 | |
| free: Unallocated | 192.168.10.232/29 | 8 / 8 | |
| free: Unallocated | 192.168.10.240/28 | 16 / 16 |
Request ledger
Rows remain in entered order; processing position shows the chosen policy. Spare hosts exclude LAN network and broadcast addresses.
| Request / kind | Processing position | Requested / required block | Allocation / mask | Usable range | Broadcast / wildcard | Usable / spare hosts |
|---|---|---|---|---|---|---|
| Stafflan | 1 | 100 hosts / 128 addresses (/25) | 192.168.10.0/25 255.255.255.128 | 192.168.10.1 through 192.168.10.126 | 192.168.10.127 0.0.0.127 | 126 / 26 |
| Guestslan | 2 | 50 hosts / 64 addresses (/26) | 192.168.10.128/26 255.255.255.192 | 192.168.10.129 through 192.168.10.190 | 192.168.10.191 0.0.0.63 | 62 / 12 |
| Deviceslan | 3 | 20 hosts / 32 addresses (/27) | 192.168.10.192/27 255.255.255.224 | 192.168.10.193 through 192.168.10.222 | 192.168.10.223 0.0.0.31 | 30 / 10 |
| Router linkpoint-to-point | 4 | 2 hosts / 2 addresses (/31) | 192.168.10.224/31 255.255.255.254 | 192.168.10.224 through 192.168.10.225 | No broadcast 0.0.0.1 | 2 / 0 |
| Loopbackhost-route | 5 | 1 hosts / 1 addresses (/32) | 192.168.10.226/32 255.255.255.255 | 192.168.10.226 through 192.168.10.226 | No broadcast 0.0.0.0 | 1 / 0 |
Keep the complete plan
CSV includes both policies, all requests including failures, all free blocks, exact counts and assumptions. Import address and CIDR columns as text.
How to use this calculator
- Load Office network example or Fragmentation example, then select Edit networks and reservations.
- Enter Parent IPv4 CIDR. Add aligned Reserved CIDRs for existing allocations that must remain untouched. Reservations cannot overlap each other or extend outside the parent.
- Add requested subnets with names, subnet kinds and Required host interfaces. Include gateway interfaces. LAN size includes network and broadcast overhead; point-to-point requires 2 and host-route requires 1. Changing kind retains the host draft for explicit correction.
- Select Update subnet plan. Compare Entered order and Largest first. Inspect any unplaced request; sufficient free addresses in total may still be too fragmented or misaligned.
- Use Zoom in the address-block table to inspect a small block, then Show whole parent to return. Read masks, usable ranges, broadcast addresses and spare hosts in the request ledger.
- Download subnet CSV or open Show selectable CSV for both policies, all free blocks and complete inputs. Import addresses and CIDRs as text. Verify real deployment requirements separately.
The Formula
The mathematical logic powering this calculation is:
A /p IPv4 block contains 2^(32−p) addresses. Its network is floor(address / block size) × block size; the last address is network + size − 1. Parent host bits are normalized and explicitly reported. Reservations must already be aligned CIDRs inside the parent and must not overlap.
For a conventional LAN requesting H usable interfaces, choose the smallest power-of-two block of at least H+2 addresses, with minimum size 4 (/30). The network and final broadcast address are excluded from usable hosts. Include gateways in H. A point-to-point /31 uses both addresses for its two endpoints under RFC 3021; a /32 host route uses one address. Neither is reported with a broadcast address here.
Subtract reserved blocks from the parent. For each request, scan free intervals in ascending address order and choose the lowest aligned block that fits. Entered-order policy follows the request list. Largest-first sorts by required block size descending, with stable entered-order ties. Failed requests remain visible and later requests are still attempted. These are deterministic allocation policies, not a general optimal packing solver.
Free intervals are decomposed into maximal aligned CIDRs. Allocated + reserved + free addresses equals parent size. Spare hosts = usable hosts − requested hosts. The dotted-decimal mask has p leading one bits; the wildcard is its 32-bit complement. All counts and allocations use exact integer arithmetic; visualization projects address offsets only after exact clipping.
Bounds: parent prefix 0–32; at most 32 reservations and 64 requests. LAN hosts are whole decimal integers 1–4,294,967,294; point-to-point requires exactly 2; host-route requires exactly 1. IPv4 octets reject leading zeros and CIDR prefixes reject padding, signs and whitespace. Labels allow 80 characters. Zero requests and a fully reserved parent are valid.
This is an address allocation model, not a router configuration generator or a validation of ownership, public reachability, special-purpose ranges, DHCP policy, VLAN topology, security rules or provider routing. IPv6 is not supported. A mathematically valid /0 plan does not imply the whole IPv4 space can be used as one real LAN.Worked Example
If you input:
- Parent IPv4 CIDR: 192.168.10.0/24; no reservations
- LAN requests: Staff 100, Guests 50, Devices 20 usable interfaces
- Special requests: Router link: 2 endpoints (/31); Loopback: 1 address (/32)
Result:
Both policies allocate Staff 192.168.10.0/25, Guests 192.168.10.128/26, Devices 192.168.10.192/27, Router link 192.168.10.224/31 and Loopback 192.168.10.226/32. Block sizes total 128+64+32+2+1 = 227 addresses, leaving 29 of the parent's 256 addresses free. The three LANs have 126, 62 and 30 usable hosts respectively, leaving 26, 12 and 10 spare hosts. The /31 and /32 have no spare hosts.
Frequently Asked Questions
How does VLSM reduce wasted IPv4 address space?
Variable-length subnet masking allocates different block sizes for different host requirements. A 100-host LAN needs a /25, while a 20-host LAN needs a /27 under the conventional network-and-broadcast exclusions. This avoids allocating the same oversized block to every network.
Why can allocation order change whether requests fit?
Alignment matters. In the fragmentation example, 10.0.0.128/32 is reserved inside a /24. Placing a single host at .0 first prevents a 126-host /25 from fitting anywhere. Largest-first places that LAN at 10.0.0.0/25, then the single host at 10.0.0.129/32. The policies are comparisons, not an assurance of optimal packing.
Are /31 and /32 normal LANs?
No. The /31 option specifically models a point-to-point link with two usable endpoint addresses under RFC 3021. A /32 represents a single host route. Select LAN for the conventional rule that excludes network and broadcast addresses. The tool does not infer your equipment's support.
Does free address count tell me the largest subnet I can add?
Not by itself. Free space may be split across reserved and allocated blocks. Check the largest available aligned block and the free CIDR ledger. A request can fail even when the sum of free addresses exceeds its block size.
Why did my parent address change?
A CIDR such as 10.20.30.77/24 identifies the network 10.20.30.0/24. The parent accepts host bits and shows both the entered and normalized forms. Reservations instead require aligned network addresses so an accidental host address does not silently reserve a larger region.
Why does a tiny subnet disappear on the map?
Widths reflect actual address counts. A single address is only one part in 4,294,967,296 of a /0, so it cannot be distinguished at an ordinary screen width. Its table row remains available. Zoom into that CIDR to inspect it; the map does not inflate small blocks and distort the totals.
Does this validate public or private routing?
No. It performs IPv4 allocation arithmetic without classifying reserved or special-purpose ranges, checking address ownership, testing reachability or generating device configuration. Review your actual addressing policy and equipment before applying a plan.
Similar Calculators
Data Transfer Time Calculator
Estimate file upload, backup, copy, or migration time from data size, throughput, overhead, and batches.
Erlang C Calculator
Compare Erlang C staffing, service level, occupancy and waiting time for one pooled queue, with target staffing and an exportable comparison.
Server Power Cost Calculator
Compare server fleets with active, idle and standby schedules, PUE, time-of-use rates and coincident demand. Visualize hourly power, monthly costs and upgrade payback.
