IP Supernetting (CIDR Aggregation)

Enter IPv4 or IPv6 addresses, CIDR blocks or ranges and get the smallest set of CIDR prefixes that covers them, plus the single smallest supernet and how much extra address space it wastes.

Use the tool

Why this tool exists

Firewall rules, route tables and allow-lists grow into long lists of adjacent blocks. Merging 10.0.0.0/24 and 10.0.1.0/24 into one /23 is easy, but doing it across dozens of entries, mixed with single addresses and ranges, is error-prone. A wrong merge opens up more address space than intended.

This calculator merges overlapping and adjacent entries into the minimal list of prefixes, so you can shorten a rule set without changing what it matches. It also reports the one smallest supernet that contains everything and how many addresses it adds beyond your list, which helps you decide whether a single summary route is acceptable. The calculation runs in your browser and nothing is uploaded.

How to use it

  1. Enter addresses, CIDR blocks or ranges written as a-b, one per line.
  2. Read the minimal list of CIDR prefixes that covers exactly the same addresses.
  3. Check the smallest single supernet and the wasted address space it implies.
  4. Copy the aggregated list into your firewall, route table or allow-list.

Frequently asked questions

Does aggregation change what is matched?

The minimal prefix list covers exactly the same addresses as your input, no more and no less. The single supernet is different: it can include extra addresses, and the tool shows how many.

Can I mix IPv4 and IPv6?

Yes. The two families are aggregated separately because they cannot be merged. You will see one result list for IPv4 and another for IPv6.

What if my ranges do not align to prefixes?

A range such as 10.0.0.5 to 10.0.0.20 does not match a single prefix, so it is split into several smaller blocks. The tool produces the smallest set that covers the range exactly.