Skip to main content
Fully client-side · IPv4 + IPv6 · shareable links

Subnet splitter.

Start with one network, split any block in half, join siblings back together, name each subnet, and export the plan to Terraform, JSON, CSV or Markdown. Your layout lives in the page address, never on our servers.

Subnets in this layout
Label / purposeCIDRNetmaskFirst - last usableUsableAWS usableActions
10.0.0.0/16255.255.0.010.0.0.1 - 10.0.255.25465,53465,531

Usable = total minus network and broadcast (a /31 keeps both addresses, a /32 is one host). AWS usable = total minus 5 (network, VPC router, DNS, reserved, broadcast); AWS only allows /16 to /28. 1 subnet.

Export
resource "aws_subnet" "subnet_1" {
  vpc_id = aws_vpc.main.id
  cidr_block = "10.0.0.0/16"
  tags = {
    Name = "subnet-1"
  }
}

The layout lives in the page address after the #, so it is never sent to our server. Anyone you share the link with sees the same labels and splits.

What this tool does

Most subnet calculators answer a single question: what is inside this one block? Real network planning asks the reverse. You own a 10.0.0.0/16 and need to decide how it is divided between production and staging, between three availability zones, between public, private and database tiers. That job is called variable-length subnet masking, or VLSM, and it is a drawing exercise as much as an arithmetic one. The splitter lets you do it as a drawing. Type a network, press Split on any row to cut that block into two equal halves, and press Join to merge two halves back into the parent. Every row shows the CIDR, netmask, the first and last usable address, and how many addresses you really get, both by the standard rule and by the AWS rule.

Give each row a label such as prod-private-az1. When the layout looks right, pick an export format and copy it straight into a pull request. The Terraform export writes one aws_subnet resource per row, with the label used as the resource name and the Name tag. The JSON, CSV and Markdown exports carry the same columns, which makes them useful for design documents and spreadsheets as well as code.

How splitting works

A CIDR block of prefix length n covers 2(width − n) addresses, where the width is 32 for IPv4 and 128 for IPv6. Adding one bit to the prefix halves the block. A /24 becomes two /25 blocks: the lower half starts at the original network address, and the upper half starts exactly halfway through. Splitting again turns each /25 into two /26 blocks, and so on. The tool never lets you create a block that is not aligned to its own size, because such a block cannot be written as a single CIDR prefix. Alignment is the property that makes routing tables small, and it is the reason a plan drawn as a tree always works.

Two blocks can only be joined when they are siblings: the same size, adjacent, and sharing the same parent. 10.0.0.0/25 and 10.0.0.128/25 are siblings and merge into 10.0.0.0/24. By contrast, 10.0.0.128/25 and 10.0.1.0/25 are neighbours with the same size, but they belong to different parents and cannot be written as a single prefix. If you need to merge arbitrary ranges rather than undo your own splits, the CIDR aggregator does that job.

Usable addresses: the standard rule and the AWS rule

On an ordinary IPv4 subnet the first address is the network address and the last is the broadcast address, so a block of 2h addresses has 2h − 2 usable hosts. A /24 has 254, a /26 has 62. Two prefixes are special: a /31 keeps both addresses for point-to-point links (RFC 3021), and a /32 is a single host route.

Cloud providers take more. AWS reserves five addresses in every subnet, which is why the tool shows a second column. For 10.0.1.0/24 the reserved addresses are:

  • 10.0.1.0 — the network address.
  • 10.0.1.1 — the VPC router.
  • 10.0.1.2 — the Amazon-provided DNS resolver (in a VPC the resolver is also reachable at the VPC base plus two).
  • 10.0.1.3 — reserved for future use.
  • 10.0.1.255 — the broadcast address, which AWS reserves even though VPCs do not support broadcast.

That leaves 251 usable addresses in a /24. The effect is larger on small subnets: a /28 has 16 addresses, 14 by the standard rule, and only 11 on AWS. AWS also restricts IPv4 subnet sizes to between /16 and /28, so the tool shows n/a outside that range rather than an invented number. Remember too that many managed services consume addresses of their own: each Lambda function attached to a VPC, each load balancer node and each EKS pod using the VPC CNI takes an address, so a subnet that looks generous on paper can run dry sooner than expected.

Sizing subnets for AWS and GCP multi-AZ designs

A subnet in AWS lives in exactly one availability zone, so a highly available design multiplies every tier by the number of zones. A typical layout for a /16 VPC across three zones has four tiers: public (load balancers and NAT gateways), private application, private data and a small management or transit tier. Twelve subnets in total. Carving them from a tree is natural: split the /16 into four /18 quarters, keep one as spare capacity, and split the others to the sizes you need.

  • Give the big consumers the big blocks. Container platforms and autoscaled fleets exhaust addresses first, so put them in /20 or /19 subnets. Public subnets that only hold load balancer nodes and NAT gateways fit comfortably in a /26 or /27.
  • Leave unallocated space. You cannot enlarge a subnet after resources exist in it. Leaving a whole sibling block unused lets you add a subnet later, or attach a secondary CIDR to the VPC, without renumbering.
  • Plan for peering and transit. Two VPCs with overlapping ranges cannot be peered, and overlap also breaks Transit Gateway routing and most VPN setups. Allocate each VPC, account and region a distinct slice of a company-wide supernet, such as one /16 per VPC out of 10.0.0.0/8.
  • GCP differs in shape, not in maths. Google Cloud subnets are regional rather than zonal, so one subnet per tier per region is enough for multi-zone redundancy. GCP reserves four addresses per primary range (network, gateway, and the last two), and lets you expand a subnet in place, which makes under-sizing less painful than on AWS.

Home lab and office: Proxmox and UniFi VLANs

The same tree helps on a smaller scale. A common home-lab design uses one VLAN per trust zone: trusted devices, IoT, guests, servers and a management network. A /24 per VLAN is the conventional choice, with the third octet matching the VLAN ID, so VLAN 20 is 10.0.20.0/24. That makes firewall rules and logs readable at a glance. When you would rather save the space, split a single /22 into four /24 blocks and label them, or drop to /27 for tiny segments such as a management VLAN with six devices. On UniFi, each VLAN-only network needs its own subnet and gateway address, and on Proxmox the bridge or VLAN-aware vmbr interface needs an address inside the subnet you choose, so write that address down in the label too.

Power-of-two alignment traps

Almost every subnetting mistake comes from forgetting that block sizes are powers of two and that each block must start on a multiple of its own size. These are the traps to watch for:

  • The odd start address. 10.0.0.64/25 is not a valid network. A /25 is 128 addresses long, so it can only start at 0 or 128 in the last octet. The tool zeroes the host bits for you when you type a network, and shows the normalised result in the input box so you notice.
  • Mixed sizes in the wrong order. If you place a small subnet at the start of a range, the next large subnet has to skip forward to the next aligned boundary, wasting everything in between. Allocate the largest blocks first. The tree approach avoids this because every split is aligned by construction.
  • Counting hosts, not addresses. A segment that needs 30 devices does not fit in a /27, which has 30 usable addresses on paper and none left for the gateway. Size for the host count plus the gateway, plus growth, and on AWS plus the three extra reserved addresses.
  • Forgetting the router. The default gateway takes one of the usable addresses. In HA pairs with VRRP or HSRP you also need a virtual address plus one for each member.
  • Overlapping private ranges. The most popular choices, 192.168.0.0/24 and 192.168.1.0/24, are the ones your home router, your hotel Wi-Fi and half of your colleagues already use. A VPN to such a network fails or misroutes. Prefer less common blocks inside 10.0.0.0/8 or 172.16.0.0/12 for anything you may later connect.

IPv6 planning is simpler

IPv6 removes most of this arithmetic. A site normally receives a /48 (or at least a /56 at home) and every LAN gets a /64, which leaves 16 bits, or 65,536 subnets, to hand out inside a /48. There is no broadcast address, so every address in a prefix counts as usable, and cloud providers such as AWS fix IPv6 subnets at /64. The splitter treats IPv6 the same way as IPv4 so you can still sketch a tree, for example splitting a /48 into per-site /52 blocks, but it deliberately hides the AWS column because that rule does not apply. Do not subnet longer than /64 for ordinary LANs, since SLAAC depends on a 64-bit interface identifier. For a deeper tour of the address format, see the IPv6 toolkit.

Sharing and exporting your plan

The splitter stores the whole layout in the fragment of the page address, the part after the #. Browsers do not send the fragment to servers, so your network design stays private, and you can still bookmark the page or paste the link into a ticket. A link encodes the root network, the shape of the split tree and the labels. Opening it recreates the same table. A layout that was never edited, that is, the bare root with no labels, leaves the address clean.

The Terraform export is written to be safe to paste: resource names are limited to letters, digits and underscores, text inside tags has any template syntax escaped, and every subnet points at aws_vpc.main.id, so rename that reference to match your VPC and add the availability_zone argument yourself. IPv6 rows are written with ipv6_cidr_block instead of cidr_block. CSV cells that start with a spreadsheet formula character are prefixed so that opening the file in Excel or Sheets cannot execute anything. Because these exports are generated from your labels, review them as you would any generated code before applying them to a live account.

Frequently asked questions

How many IP addresses does AWS reserve in every subnet?

Five: the network address, the VPC router, the Amazon DNS resolver, one reserved for future use and the broadcast address. A /24 therefore has 251 usable addresses, and the smallest IPv4 subnet AWS accepts, a /28, has 11.

Why can I not split a /24 into three equal subnets?

Each split cuts a block into two equal halves because each extra prefix bit doubles the number of blocks. Three equal parts do not exist. Split into four /26 blocks and keep one spare, or split once and then split only one half again to get a /25 and two /26 blocks.

What size should my AWS or GCP subnets be?

Choose the VPC range first, usually a /16, then carve one subnet per tier per availability zone. Large private subnets between /19 and /22 suit container and autoscaling workloads, and /26 to /28 suit public and load balancer tiers. Leave whole blocks unallocated, because a subnet cannot be resized once resources run in it.

Is my subnet plan sent to your server?

No. The maths runs in your browser and the layout lives only in the address-bar fragment, which is never part of an HTTP request.

Related tools

Use the CIDR calculator to inspect a single block, the CIDR aggregator to merge a list into the shortest set of prefixes, and the public versus private IP guide to choose ranges that will not collide with a home or office network. Writing firewall rules from the plan? The port checker confirms what is actually reachable from the internet afterwards.