BGP Prefix Aggregation Calculator

Summarize IPv4 and IPv6 CIDR routes into the smallest exact prefix set, remove duplicates and contained routes, and compare route count against a single covering prefix.

All prefix processing stays in your browser. Results evaluate address coverage, not BGP attributes or whether an aggregate is safe to advertise.

CIDR prefixes

Use one CIDR per line, or separate entries with spaces, commas, or semicolons. Host bits are normalized to the prefix boundary. Maximum 5,000 entries.

Ready to aggregate the example prefixes.

Aggregation result

Run the calculator to see exact summaries, route reduction, address coverage, and the covering-prefix comparison.

Advertisement

Advertisement

How to use the BGP aggregation calculator

  1. Paste CIDRs: add IPv4, IPv6, or both. Each entry must include a prefix length.
  2. Aggregate: invalid entries stop the calculation and are identified; host bits are normalized.
  3. Use the exact list first: it covers precisely the union of the valid input address space.
  4. Inspect the covering-prefix warning: a single summary may include gaps that were not present in the input.
  5. Validate policy: check RPKI, filtering, attributes, reachability, and failure behavior before advertising anything.

CIDR summarization formula and assumptions

A prefix of length p in an address family of b bits contains 2^(b - p) addresses. IPv4 uses 32 bits and IPv6 uses 128 bits.

Exact merge rule: adjacent ranges are converted back to the largest power-of-two blocks that are both aligned and fully covered. Two sibling /p routes therefore become one /(p - 1) only when the complete parent is present.

Single covering prefix: compare the lowest and highest covered addresses. The prefix length is the number of equal leading bits; equivalently, b - bitLength(low XOR high).

Route reduction: (input route count - exact output route count) / input route count × 100%. Duplicate and already-contained input routes count as removable entries.

The tool treats every input prefix as address coverage with equal status. It does not import AS_PATH, origin, MED, communities, local preference, next hop, RPKI ROAs, or router policy, so it cannot decide whether the mathematical aggregate should be announced.

Worked prefix aggregation examples

Four contiguous IPv4 /24 routes

10.20.0.0/24 through 10.20.3.0/24 cover 1,024 aligned addresses. The first two combine to 10.20.0.0/23, the next two combine to 10.20.2.0/23, and those siblings combine to 10.20.0.0/22. Four routes become one with no added address space.

A gap prevents a lossless single route

192.0.2.0/24 and 192.0.4.0/24 remain two exact routes. Their smallest single covering prefix is 192.0.0.0/21, which also covers six other /24-sized blocks. The covering prefix is shorter, but it is not equivalent to the input.

IPv6 aggregation uses the same bit rule

2001:db8:100::/49 and 2001:db8:100:8000::/49 are the two aligned halves of 2001:db8:100::/48, so they can be collapsed exactly.

Standards, limits, and technical review

The address calculations follow the classless prefix model. Operational BGP aggregation has additional path-attribute and policy requirements outside the address math shown here. RFC 9774 now prohibits advertising AS_SET and AS_CONFED_SET path segments by default and specifies consistent brief aggregation; older descriptions of building AS_SETs from contributing routes are no longer current practice.

Methodology author: Starlight Robotics infrastructure tooling team. Technical review: prefix and BGP behavior checked against the RFCs above. Reviewed: 28 July 2026.

BGP prefix aggregation FAQs

What is BGP prefix aggregation?

BGP prefix aggregation advertises a less-specific route that represents multiple more-specific networks. Exact aggregation reduces route count without adding address space; a broader covering route may also include addresses absent from the input.

When can two CIDR prefixes be combined exactly?

Two same-size sibling prefixes can combine when they are adjacent, aligned on the parent boundary, and together cover that parent completely. The process can repeat with the resulting parent.

What is the difference between an exact summary and a covering prefix?

An exact summary represents only addresses covered by the input. A covering prefix is the single smallest prefix spanning the first through last input address and can include gaps.

Does route aggregation change BGP path attributes?

It can. Production aggregation must account for AS_PATH, ATOMIC_AGGREGATE, AGGREGATOR, communities, next hop, policy, RPKI authorization, and vendor behavior. This calculator evaluates address coverage only.

Can I mix IPv4 and IPv6 prefixes?

Yes. IPv4 and IPv6 are calculated independently because one prefix cannot cover both address families.

Are my prefixes uploaded?

No. Prefix parsing and aggregation run locally in the browser, and the tool does not submit or store the entered prefix list.

Production routing disclaimer

This calculator is a planning aid, not router configuration advice. Before advertising an aggregate, verify ownership and reachability for every covered address, more-specific withdrawal behavior, discard/null routing, prefix filters, maximum-prefix limits, AS_PATH and communities, RPKI ROAs and maxLength, traffic-engineering intent, and vendor-specific configuration.

Explore more tools