# VLSM Subnet Planner: Split a Network into Subnets

Split an IPv4 or IPv6 network into subnets. split need: give lines "name: hosts" or "name: /prefix" and each requirement gets the smallest subnet that holds it (hosts + network and broadcast, plus 5 reserved for aws or azure, 4 for gcp), placed largest first without gaps. split equal: cut the network into equal subnets by prefix or by count. Returns each allocation (name, CIDR, first and last address, usable hosts, unused), the free blocks left, utilisation, anything that did not fit with the reason, and a suggested network size when the plan does not fit. IPv6 plans give every subnet a /64. Up to 256 requirements and 4,096 rows. No network lookups.

**Not for:** Checking whether an address is inside a block (use cidr_contains).

- Tool id: `subnet-plan`
- Category: ip
- Execution: pure
- MCP tool `subnet_plan` at https://lookupowl.com/mcp
- REST `GET https://lookupowl.com/api/v1/tools/subnet-plan` (or POST a JSON body)
- OpenAPI: https://lookupowl.com/api/openapi.json

## Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `network` | string | yes |  | The network to split, as a CIDR block: 10.20.0.0/22 or 2001:db8:1234::/48. min length 1, max length 100 |
| `split` | "need" \| "equal" | no | `"need"` | need: subnets sized for the requirements, largest first. equal: equal subnets of one size. |
| `requirements` | string | no | `""` | split need: one per line, "name: hosts" or "name: /prefix", for example "Servers: 200" or "Guests: /26". Up to 256 lines. max length 20000 |
| `equalPrefix` | integer | no |  | split equal: the prefix length of each subnet, for example 26. Give this or `subnets`. min 1, max 128 |
| `subnets` | integer | no |  | split equal: how many equal subnets (a power of two is used). Give this or `equalPrefix`. min 1, max 4096 |
| `cloud` | "none" \| "aws" \| "azure" \| "gcp" | no | `"none"` | Reserved addresses to leave in every subnet: none, aws (5), azure (5) or gcp (4). |
| `nibble` | boolean | no |  | IPv6: align subnets on a hex digit (4-bit) boundary. Default on for IPv6, off for IPv4. |

## Output

Results are wrapped in an envelope: `tool`, `version`, `requestId`, `data`, `summary`, `meta` (cache status, timing), `permalink`. `data` has these fields:

| Field | Type | Description |
|---|---|---|
| `network` | string |  |
| `family` | number |  |
| `cloud` | "none" \| "aws" \| "azure" \| "gcp" |  |
| `strategy` | "largest_first" \| "equal" |  |
| `allocations` | object[] |  |
| `free` | object[] |  |
| `utilisation` | object |  |
| `unplaced` | object[] |  |
| `suggestion` | object | When the plan does not fit: the prefix of a network that would hold all of it ("a /23 would hold all of it"). |
| `equalCount` | string | Equal split: how many subnets it made (all are in allocations). |
| `notes` | string[] | Plain-English notes: the IPv6 /64 rule, cloud reserved addresses, a prefix that was rounded. |
| `exports` | "csv" \| "json" \| "terraform-aws" \| "terraform-azure"[] |  |

## Examples

### An office network sized by need

```json
{"network":"10.20.0.0/22","split":"need","requirements":"Servers: 200\nOffice: 120\nGuests: 50\nPrinters: 12\nUplink: 2","cloud":"none"}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/subnet-plan?cloud=none&network=10.20.0.0%2F22&requirements=Servers%3A+200%0AOffice%3A+120%0AGuests%3A+50%0APrinters%3A+12%0AUplink%3A+2&split=need'
```

Web page: https://lookupowl.com/vlsm-calculator?q=10.20.0.0%2F22&requirements=Servers%3A+200%0AOffice%3A+120%0AGuests%3A+50%0APrinters%3A+12%0AUplink%3A+2

### Needs that do not fit

```json
{"network":"10.20.0.0/24","split":"need","requirements":"Servers: 200\nOffice: 120\nGuests: 50\nPrinters: 12\nUplink: 2","cloud":"none"}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/subnet-plan?cloud=none&network=10.20.0.0%2F24&requirements=Servers%3A+200%0AOffice%3A+120%0AGuests%3A+50%0APrinters%3A+12%0AUplink%3A+2&split=need'
```

Web page: https://lookupowl.com/vlsm-calculator?q=10.20.0.0%2F24&requirements=Servers%3A+200%0AOffice%3A+120%0AGuests%3A+50%0APrinters%3A+12%0AUplink%3A+2

### An IPv6 /48 into sixteen /52s

```json
{"network":"2001:db8:1234::/48","split":"equal","requirements":"","equalPrefix":52,"cloud":"none","nibble":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/subnet-plan?cloud=none&equalPrefix=52&network=2001%3Adb8%3A1234%3A%3A%2F48&nibble=true&requirements=&split=equal'
```

Web page: https://lookupowl.com/vlsm-calculator?q=2001%3Adb8%3A1234%3A%3A%2F48&equalPrefix=52&nibble=true&split=equal

## Web pages

- https://lookupowl.com/vlsm-calculator

## Limits and caching

- Cost: 1 unit for a live lookup, 1 unit for a cached one. Budgets are per network and published in the `RateLimit` response headers.
- Cache: results are kept for 86400 s.
- Timeout: 5 s.

## Related tools

- [IP Subnet Calculator](https://lookupowl.com/tools/subnet-calculator.md): Network, broadcast, usable range, masks and exact host counts for any IPv4 or IPv6 subnet.
- [CIDR Aggregator: Merge IPs and Ranges into CIDR Blocks](https://lookupowl.com/tools/cidr-aggregate.md): Merge a messy list of IPs, ranges and CIDRs into the fewest exact CIDR blocks, with optional exclusions and firewall-ready exports.
- [IP in CIDR: Is This Address in That Block?](https://lookupowl.com/tools/cidr-contains.md): Check which IP addresses fall inside which CIDR blocks, and whether two lists of blocks overlap.
- [CIDR / IP Range Converter](https://lookupowl.com/tools/ip-range-convert.md): Turn CIDR blocks into first/last addresses, and IP ranges into the minimal list of CIDR blocks.
- [IPv6 Compress and Expand](https://lookupowl.com/tools/ipv6-format.md): Shorten IPv6 addresses to RFC 5952 canonical form, or expand them to the full 32-digit form.

## Guide: VLSM subnet planner

Split a network into subnets sized for what each team needs, see the free space that is left, and export the plan.

### What VLSM means

Variable length subnet masking means not every subnet in a network has to be the same size. A server network of 200 hosts and a point-to-point link of 2 hosts do not need the same block, and giving both a /24 wastes most of the address space. A VLSM plan gives each one the smallest block that holds it.

This planner takes a network, such as `10.20.0.0/22`, and a list of needs, such as `Servers: 200` or `Guests: /26`. It sorts them, gives each the right size, places them without gaps, and shows what is left over as free blocks you can use later.

### How the sizes and the order are chosen

A subnet needs room for its hosts plus two addresses that cannot be given to a host, the network address and the broadcast address. So 200 hosts need 202 addresses, and the next power of two is 256, which is a /24. Fifty hosts need 52, which rounds up to 64, a /26.

The planner places the biggest subnets first. A block must start on an address that is a multiple of its own size, so putting small blocks first can leave a hole that no larger block can use. Largest first keeps every block aligned and the free space in as few pieces as possible.

| Hosts needed | Addresses needed | Block |
|---|---|---|
| 200 | 202, rounds to 256 | `/24` |
| 120 | 122, rounds to 128 | `/25` |
| 50 | 52, rounds to 64 | `/26` |
| 12 | 14, rounds to 16 | `/28` |
| 2 | 4 | `/30` |

### When the plan does not fit

A plan that is too big is not an error. The subnets that fit are placed, the ones that did not are listed with how much room they needed and how much was left in the largest free block, and the page says how large a network would hold everything. Plan the same needs in a /24 instead of a /22 and you see at once which teams do not fit.

### Cloud networks and IPv6

Cloud providers keep addresses in every subnet for themselves. Amazon VPC and Azure keep five, Google Cloud keeps four. Choose the provider under More options and the planner adds those addresses to each need, so a subnet for 60 hosts becomes a /25 in AWS, not a /26. Providers also set the smallest subnet they allow, and the planner raises smaller needs to that size and tells you.

IPv6 is different. Subnets are not sized by host count, because a /64 already holds more addresses than any link will use, and features such as SLAAC need a /64. Every IPv6 subnet here gets a /64 and the plan counts subnets. The equal split can also line each subnet up on a hex digit boundary, so the addresses read cleanly.

### Export and privacy

The plan can be copied as CSV, as JSON, or as Terraform `aws_subnet` or `azurerm_subnet` blocks. With JavaScript on, the plan is worked out in your browser and nothing you type is sent to us. Without JavaScript the form sends your network and needs to our server in the page address. The [subnet calculator](https://lookupowl.com/subnet-calculator) shows the details of any one block from the plan.

### Frequently asked questions

**What is the difference between VLSM and fixed-size subnetting?**

Fixed-size subnetting cuts a network into equal pieces. VLSM lets each subnet have the size it needs, so less address space is wasted. This page does both: sized by need, or an equal split.

**Why are the largest subnets placed first?**

Blocks must start on a multiple of their own size. Placing large blocks first keeps them aligned and leaves the free space in a few large pieces. Placing small blocks first can fragment the space so that a later large block no longer fits.

**How many hosts does a /24 hold?**

A /24 has 256 addresses and 254 usable hosts, because the network address and the broadcast address are not given to hosts. In AWS and Azure it holds 251, and in Google Cloud 252, because the provider keeps some.

**Why does every IPv6 subnet get a /64?**

IPv6 hosts configure themselves on a /64, and a /64 holds about 18 quintillion addresses. Sizing IPv6 subnets by host count does not save anything, so the planner counts subnets instead.

**Can I write a size as a prefix instead of a host count?**

Yes. Write `Guests: /26` and that subnet is exactly a /26. A line such as `Servers: 200` means 200 hosts. You can mix both in one list.

**How many subnets can I plan at once?**

Up to 256 named needs, or an equal split into up to 4,096 subnets. A split that would make more is refused with a note to choose a bigger prefix.
