Network and IP Planning · #04

Online CIDR Aggregator

Reduces a CIDR list to the smallest number of prefixes that cover exactly the same addresses.

  • Data is processed in your browser and not sent to a server

Tool

One prefix per line; lines starting with # are ignored. Up to 20,000 lines.

What does this tool do?

Firewall objects, prefix lists and allow lists grow into hundreds of overlapping or adjacent lines. Summarising by hand either lets extra addresses in or leaves a block out. The tool produces the shortest CIDR list that is exactly equivalent to the input: it never adds an address that was not covered.

How to use it

  1. Paste one CIDR per line; IPv4 and IPv6 may be mixed.
  2. An address without a prefix counts as /32 or /128. Lines with host bits set (e.g. 10.1.0.5/24) are converted to the network and flagged.
  3. Press Calculate and copy the result.

Fields

CIDR list
One prefix per line; lines starting with # are ignored. Up to 20,000 lines.

Worked example

InputValue
CIDR list
10.1.0.0/25
10.1.0.128/25
10.1.1.0/24
192.0.2.0/26
2001:db8:0:1::/64
2001:db8::/64

Expected result: 6 entries reduce to 3 prefixes: 10.1.0.0/23, 192.0.2.0/26, 2001:db8::/63.

The two adjacent /25s merge into a /24, and that /24 with 10.1.1.0/24 into a /23, because 10.1.0.0 starts on a /23 boundary. In IPv6, 2001:db8::/64 and 2001:db8:0:1::/64 are adjacent and become a /63. 192.0.2.0/26 stays on its own.

Method and assumptions

Each prefix becomes a [first, last] address range; ranges are sorted and overlapping or adjacent ones merged. Each merged range is split into CIDRs using the largest aligned blocks. The result is the minimum number of prefixes covering the same set.

IPv4 and IPv6 are handled separately with 128-bit integer arithmetic. Two adjacent but unaligned blocks cannot become one prefix (10.0.1.0/24 + 10.0.2.0/24 do not merge, because the /23 boundaries are 10.0.0.0 and 10.0.2.0).

Using the result and troubleshooting

Put the output into a prefix list, object group or allow list. The number of covered addresses must equal the input; the tool shows it per family.

A more aggressive summary (e.g. a /16) is a deliberate decision that covers extra addresses; the tool does not create lossy summaries.

Limits and common mistakes

  • No lossy summaries that cover extra addresses.
  • Next hop and metric are ignored; only the address set is merged. Before merging prefixes that point to different next hops, check them with the Static Route Inventory Diff.

Frequently asked questions

Why is the result not the single prefix I expected?

If blocks are not aligned or there is a gap, one prefix cannot cover exactly the same set; it would include extra addresses.

Related tools and service

Related service: VLAN, Routing and Network Segmentation

Network online tools · See all online tools