TOOL-17 · Networking

CIDR aggregator

Paste a list of IP addresses or CIDR blocks and get back the minimal set of supernets. Useful for collapsing firewall ACLs and route summarization.

Input — IPs & CIDRs

Output — aggregated CIDRs

What "aggregation" means and why it's worth doing

Route summarization (also called supernetting or CIDR aggregation) takes a list of individual IPs or small CIDR blocks and finds the smallest set of larger blocks that covers exactly the same addresses. It matters for two practical reasons: firewall ACLs and router hardware both have limits on how many rules or routes they can hold efficiently, and a list of 40 individual /32 host entries is both harder to audit and closer to those limits than 3 well-chosen supernets covering the same hosts. It's the same principle behind why ISPs advertise one /16 to the internet instead of 256 individual /24s — fewer entries, same coverage, less table for every router in the path to hold.

How the aggregation actually works

Two steps. First, every input — a bare IP, a CIDR block — gets converted into a numeric address range (start and end). Adjacent or overlapping ranges get merged into single, larger ranges. Second, each merged range gets converted back into the minimal set of CIDR blocks that exactly covers it. That second step is the non-obvious part: a CIDR block is only valid if it starts on an address boundary aligned to its own size (a /24 must start at a multiple of 256, a /23 at a multiple of 512, and so on) — so an arbitrary range often can't be expressed as one block, and comes back as 2 or more CIDRs even after merging. This tool handles that alignment math for you; getting it wrong by hand is the single most common cause of an ACL rule that quietly covers more addresses than intended.

Worked example

Input: 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24. These four /24s are contiguous and together form exactly the range 192.168.0.0–192.168.3.255 — 1,024 addresses, which is a valid, alignment-correct /22. The aggregator merges all four inputs into the single block 192.168.0.0/22. Add a fifth, non-contiguous block like 192.168.5.0/24 and the result becomes two entries — the /22 plus the separate /24 — because there's a gap at 192.168.4.0/24 that isn't covered by any input, so the two groups can't be merged into one aligned block.

What doesn't aggregate cleanly

What's the difference between aggregation and just listing all my subnets?

Aggregation finds the minimum set of CIDR blocks that covers the same addresses as your original list — fewer, larger entries instead of many small ones. A firewall rule set or route table with fewer entries is faster to evaluate, easier to audit, and less likely to hit a hardware or software limit on rule count.

Why didn't my 4 subnets combine into 1 block?

Almost always alignment. A valid CIDR block has to start on an address boundary sized to match its own prefix — a /22 must begin at a multiple of 4 in the relevant octet. Four contiguous /24s only merge into one /22 if the first one starts on that boundary; otherwise the result stays as multiple smaller blocks even though the addresses are genuinely contiguous.

Can I aggregate a mix of single IPs and CIDR blocks together?

Yes — paste a mix of bare IPs (treated as /32s) and CIDR blocks of any size, one per line. The tool converts everything to address ranges first, merges what's contiguous or overlapping, and only then converts back to the minimal CIDR set, so mixed input works exactly like uniform input.

Is this the same thing as a route summary in OSPF or BGP?

Same underlying math, different context. OSPF/BGP route summarization is this exact aggregation problem, applied to routes a router advertises to its neighbors, for the same reason — smaller route tables are faster to process and less prone to instability. This tool does the calculation; applying the result as an actual summary route is a router-specific configuration step.

What happens if I have overlapping CIDR blocks in my input?

They merge automatically — the tool works on address ranges internally, so a /24 that fully contains a /28 you also listed collapses into just the /24, and two overlapping ranges merge into their combined span before being re-split into aligned CIDR blocks.

All processing runs locally