CALCULATE / IP60BPS / MODULE

IPV6 PREFIX COMPARE

Compare two IPv6 CIDR prefixes with exact 128-bit arithmetic and inspect containment, intersection and their smallest common prefix.

128-BIT PREFIX RELATIONSHIPLOCAL
EXAMPLES
NETWORK A
NETWORK B
RELATIONSHIPCanonical prefix relation
INTERSECTION
COMMON PREFIXSmallest CIDR covering both
HOST BITSCommon-prefix host bits

This compares IPv6 prefix math only. It does not inspect live routes, BGP announcements, ownership or reachability.

REFERENCE / FAQ

COMMON QUESTIONS

Can one IPv6 prefix contain another?

Yes. IPv6 CIDR prefixes are hierarchical. A shorter aligned prefix can contain a longer prefix when the longer network falls inside its address range.

Does this compare live IPv6 routing?

No. The module performs exact 128-bit prefix arithmetic locally in your browser. It does not test reachability, routing tables or ownership.

Why is BigInt used?

IPv6 addresses are 128 bits wide, so BigInt preserves exact address and prefix boundaries without floating-point precision loss.

PREFIX RELATIONSHIP

Two canonical IPv6 CIDRs can be equal, nested or disjoint. The comparison uses exact 128-bit integer boundaries.

COMMON PREFIX

The smallest common prefix covers both complete input networks and can be broader than either input when they are disjoint.

PRACTICAL / EXAMPLES

PUT THE NUMBER IN CONTEXT.

Short examples using the same units and assumptions as this module.

2001:db8::/32 VS 2001:db8:1::/48

The /32 contains the /48 because every address in the longer prefix falls inside the broader documentation prefix.

2001:db8:1::/48 VS 2001:db8:2::/48

The two /48 networks are disjoint but share a broader common prefix.