Subnetcalculator

IPv6 Compression Calculator

Compress, expand, and check any IPv6 address. See the RFC 5952 canonical form and the fully expanded form side by side — all computed in your browser.

Try:

IPv6 Address Compression Rules

An IPv6 address is 128 bits written as eight groups of four hex digits. Because most addresses contain long runs of zeros, RFC 5952 defines exactly one shortened (canonical) text form so that the same address is always written the same way: strip leading zeros in each group, replace the longest run of two or more all-zero groups with a single :: (leftmost run wins a tie), and use lowercase hex letters.

Example 1 — leading zeros

2001:0db8:0000:0000:0000:ff00:0042:8329

2001:db8::ff00:42:8329

0db8 → db8 and 0042 → 42; the run of three zero groups becomes ::.

Example 2 — longest run wins

2001:0:0:1:0:0:0:1

2001:0:0:1::1

The three-group zero run is compressed; the shorter two-group run stays written out.

Example 3 — all zeros

0000:0000:0000:0000:0000:0000:0000:0001

::1

The loopback address: seven zero groups collapse into :: leaving just the final 1.

Frequently asked questions

How do I check whether an IPv6 address is compressed or not?

Compare the address against its RFC 5952 canonical form: leading zeros removed from every group, the longest run of zero groups (two or more) replaced by a single ::, and all letters lowercase. If the address you have matches that form exactly, it is compressed; if it still contains leading zeros, uncompressed zero runs, or uppercase letters, it is not. Paste any address into this calculator and the badge tells you instantly.

What does :: mean in IPv6?

The double colon (::) is shorthand for one or more consecutive groups of zeros. For example, 2001:db8:0:0:0:0:0:1 compresses to 2001:db8::1, and the all-zeros address 0:0:0:0:0:0:0:0 compresses to just ::. It may appear only once per address — otherwise the number of missing groups would be ambiguous.

What are the IPv6 compression rules?

RFC 5952 defines the canonical form: (1) remove leading zeros in each 16-bit group (0db8 → db8); (2) replace the longest run of two or more consecutive zero groups with ::, choosing the leftmost run on a tie; (3) never use :: for a single zero group; (4) write hex letters in lowercase. Applying all four rules to the same address always produces one unique text representation.

IPv6 Tools

Everything you need for IPv6 addressing — free, client-side, no signup.

More Network Tools

Free tools for network engineers — no signup, no rate-limit walls.