IPv6 Address Compressor

Shorten IPv6 addresses to their canonical form and check whether an address is already canonical.

Prefixes (/64), zones (%eth0) and [brackets]:ports are kept. One per line for many; results update as you type.

Result

2001:0DB8:0000:0000:0008:0800:200C:417A →

2001:db8::8:800:200c:417a

Compressed (canonical)2001:db8::8:800:200c:417a
Expanded2001:0db8:0000:0000:0008:0800:200c:417a

Rules applied

  1. Leading zeros removed: 2001:db8:0:0:8:800:200c:417a
  2. Longest zero run: groups 3-4 (2 groups) become "::"
  3. Lower case: 2001:db8::8:800:200c:417a

Not canonical as written:

  • Uses upper-case letters; the canonical form is lower case (RFC 5952 §4.3).
  • Has leading zeros in a group; they must be removed (§4.1).
  • Doesn't use "::" for its run of 2 zero groups (§4.2.1).

How to Compress an IPv6 Address

To shorten an IPv6 address, drop leading zeros in each group and replace the longest run of zero groups with ::, once: 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.

Three rules (RFC 5952) give the one canonical form every tool should print:

  1. Remove leading zeros in each group: 0db8 → db8, 0000 → 0.
  2. Replace the longest run of two or more zero groups with ::. If two runs are equally long, replace the first.
  3. Use lower case for a to f.

The result panel shows each rule applied to your address, and says whether the address as you wrote it was already canonical.

Common Mistakes

Using :: twice, compressing a single zero group, or keeping uppercase all break the canonical form.

WrittenProblemCanonical
2001:db8::1::1Two "::": invalid, not just non-canonical(cannot be read)
2001:db8::1:1:1:1:1"::" for a single zero group2001:db8:0:1:1:1:1:1
2001::1:0:0:0:1"::" on the shorter run2001:0:0:1::1
2001:db8:0:0:1::1Equal runs: "::" must take the first2001:db8::1:0:0:1
2001:DB8::1Upper case2001:db8::1

Prefixes, Zones and Ports

2001:db8::/32, fe80::1%eth0 and [2001:db8::1]:443 are compressed the same way; the extra parts are kept.

A prefix with bits set after its length (such as 2001:db8::1/32) is flagged, because the network itself is 2001:db8::/32. Zone IDs, which say which network interface a link-local address belongs to, and ports in brackets are kept as they are. IPv4-mapped addresses keep their dotted IPv4 part (::ffff:192.0.2.1), as RFC 5952 recommends; other dotted tails are written in hex.

How This Tool Works

ItemDetail
Where it runsIn your browser; nothing is sent to our server.
Input checksEvery IPv6 text form (RFC 4291), including dotted IPv4 tails, zones, prefixes and [brackets]:ports. Invalid input gets the reason.
OutputRFC 5952 canonical form for the short version; eight groups of four digits for the full one.
Many at onceOne address per line, up to 1,000.
Shareable link?q= followed by an address opens the page with it converted.
StoredNothing.
Last verified10 November 2026

Frequently Asked Questions

How do you shorten an IPv6 address?
Remove leading zeros in each group and replace the longest run of two or more zero groups with "::", only once: 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.
Can :: be used twice in an IPv6 address?
No. With two "::" there would be no way to know how many zero groups each one stands for, so the address would be ambiguous.
Should a single 0 group become ::?
No. RFC 5952 says "::" must not stand for just one zero group: write 2001:db8:0:1:1:1:1:1, not 2001:db8::1:1:1:1:1.
Why lowercase?
RFC 5952 requires lower case so the same address is always written the same way, which makes searching logs and comparing configs reliable.

Next steps

Related Tools

IPv6 Expander
Write any IPv6 address out in full.
IPv6 Subnet Calculator
Prefixes, ranges and address counts for any IPv6 network.
IPv4 to IPv6 Converter
Every IPv6 form of an IPv4 address.

Related Guides

Guide What Is IPv6?
with a live test of your connection.