IPv4 · Local calculator

Supernet Calculator

An inventory can contain many component prefixes that fit under one shorter prefix. The supernet calculator finds the smallest single block that covers them, including any spaces between the inputs.

Inputs

Result

Covering prefix
192.0.2.0/24
Distinct input addresses
128
Extra addresses in summary
128

The summary includes space outside the listed networks.

In this guide12 sections

Introduction

An inventory can contain many component prefixes that fit under one shorter prefix. The supernet calculator finds the smallest single block that covers them, including any spaces between the inputs.

Formula and calculation

Smallest covering IPv4 supernet
prefix = common leading bits of minimum start and maximum end; extra = cover size − distinct input addresses

The calculator finds the smallest aligned prefix containing all supplied blocks. A summary can include addresses that were not in the input networks; that excess is reported explicitly.

cover size · addresses
number of addresses in the calculated supernet
distinct input addresses · addresses
union size of the supplied prefixes

Method and concepts

Find the lowest network address and the highest final address among the components. Compare these two values from the most significant bit and stop at their first difference. The shared leading bits define the longest possible covering prefix. Every unshared bit can vary throughout that cover.

  1. Supply the component IPv4 prefixes. Include the full prefix length for each so the calculator can determine both endpoints.
  2. Compare the resulting supernet with the union of the original blocks. Inspect alignment and check for gaps.
  3. Use a single summary in an address plan only when including the additional covered space suits that plan.

CIDR and route aggregation diagram

  1. 0.0.0.0/0 · default
  2. 198.51.100.0/23 · campus
  3. 198.51.101.128/25 · east wing
  4. 198.51.101.180 · destination
All three prefixes contain the destination. In the illustrated IPv4 forwarding table, the east-wing /25 wins the longest-prefix comparison.

Worked examples

Compare an exact summary with a summary containing holes

  1. 192.0.2.0/26 and 192.0.2.64/26 fill .0 through .127. Both halves share 25 leading bits, so 192.0.2.0/25 covers exactly those addresses.
  2. Replace the second component with 192.0.2.128/26. The new extreme fourth octets, 0 and 191, disagree in the first bit. Only the first 24 address bits are shared.
  3. The cover grows to 192.0.2.0/24. The inputs occupy .0–.63 and .128–.191. The two remaining 64-address intervals are additional space in the summary.

CIDR and route aggregation: Compare an aggregate with a more specific route

  1. The adjacent blocks 198.51.100.0/24 and 198.51.101.0/24 differ only in the last bit of octet three. Their /23 parent begins at the even third octet 100 and contains 512 addresses.
  2. A destination of 198.51.101.180 also matches 198.51.101.128/25 because 180 lies between 128 and 255. Forward using the /25 entry when both entries are installed in the selected table.
  3. For 198.51.101.44, the /25 fails because 44 is below 128. The /23 still matches. For 192.0.2.1, neither specific prefix matches and the displayed default applies.

Reference table

Supernet Calculator reference
Fourth-octet input intervalsSingle coverAdditional addresses
.0–.63 plus .64–.127192.0.2.0/250
.0–.63 plus .128–.191192.0.2.0/24128

Reading the result

Identical or contained components do not enlarge a cover. Two adjacent equal-sized blocks combine exactly only when they are the two aligned halves of one parent. A numerical summary says nothing about how an operator has routed the component networks.

Common mistakes

  • Averaging the input prefix lengths instead of checking the high-order bits of the endpoints.
  • Counting a contained subnet twice when estimating how much of the summary is occupied.

Frequently asked questions

Can adjacent /24s require a cover larger than /23?

Yes. The third octets of 192.0.1.0/24 and 192.0.2.0/24 straddle a /23 boundary. Their single cover is 192.0.0.0/22, which also includes the .0 and .3 blocks.

What happens with two completely different first bits?

Their common prefix length is zero. The smallest single cover is 0.0.0.0/0, spanning the full IPv4 address space.

Can a /0 serve as an aggregate?

Mathematically it covers the entire family. In an IPv4 forwarding table, 0.0.0.0/0 is commonly used as the default route.

What happens when a component is already inside another input prefix?

Including it again changes neither the union nor the minimal covering prefix. To count additional space accurately, count distinct addresses in the union.

What does the slash number in CIDR notation count?

It is the number of leading address bits fixed by the prefix. For example, /24 fixes 24 bits and leaves eight bits in an IPv4 address.

Can a CIDR prefix represent a single address?

Yes. IPv4 /32 and IPv6 /128 represent exactly one address value and are commonly used for host routes or narrow policy entries.

Does CIDR notation by itself say which addresses a site assigned to hosts?

No. It identifies a prefix range. It does not show leases, reservations, router interfaces, exclusions, or whether a destination is reachable.

Why does longest-prefix match matter?

When several routes match a destination, routers generally prefer the most specific matching prefix, subject to routing-table policy and route selection rules.

What makes a CIDR prefix aligned?

All host bits in the network address are zero. If a supplied address has host bits set, its containing prefix begins at the nearest lower boundary for that prefix length.

Can two adjacent prefixes be summarized as one route?

Only when they are equal-sized, adjacent, and their combined range aligns on the larger prefix boundary. Route policy and downstream reachability must also support the summary.

Does a more-specific route always win in every routing decision?

Longest-prefix match selects the most specific matching route in the forwarding table, but protocol preference, policy, and route installation decide which candidates enter that table.

Does CIDR describe the allocation authority?

No. CIDR is a notation and routing technique. Registration records and address-management documentation describe allocation and stewardship.

How is a dotted IPv4 subnet mask related to CIDR?

A contiguous mask has a run of one bits followed by zero bits. The number of leading ones is the CIDR prefix length, such as 255.255.255.0 for /24.

Can an IPv6 network use CIDR notation?

Yes. The slash count works for either family: IPv4 prefixes range from /0 to /32, and IPv6 prefixes from /0 to /128.

What is a supernet?

A supernet is a larger prefix that aggregates smaller adjacent networks. It can reduce routing table entries when the component routes share a valid aligned parent range.

Why can route aggregation hide a failure?

A summary can continue to advertise reachability for a broad block even when one component network is unavailable. Routing design must ensure that a summary is withdrawn or backed by a path that can deliver the traffic.

What does a /0 route mean?

It matches every destination in its address family and is used as a default route when no more specific route is available.

Further learning and references