IPv6 Address Compressor |
Prefixes (/64), zones (%eth0) and [brackets]:ports are kept. One per line for many; results update as you type.
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:
- Remove leading zeros in each group:
0db8→db8,0000→0. - Replace the longest run of two or more zero groups with
::. If two runs are equally long, replace the first. - 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.
| Written | Problem | Canonical |
|---|---|---|
2001:db8::1::1 | Two "::": invalid, not just non-canonical | (cannot be read) |
2001:db8::1:1:1:1:1 | "::" for a single zero group | 2001:db8:0:1:1:1:1:1 |
2001::1:0:0:0:1 | "::" on the shorter run | 2001:0:0:1::1 |
2001:db8:0:0:1::1 | Equal runs: "::" must take the first | 2001:db8::1:0:0:1 |
2001:DB8::1 | Upper case | 2001: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
| Item | Detail |
|---|---|
| Where it runs | In your browser; nothing is sent to our server. |
| Input checks | Every IPv6 text form (RFC 4291), including dotted IPv4 tails, zones, prefixes and [brackets]:ports. Invalid input gets the reason. |
| Output | RFC 5952 canonical form for the short version; eight groups of four digits for the full one. |
| Many at once | One address per line, up to 1,000. |
| Shareable link | ?q= followed by an address opens the page with it converted. |
| Stored | Nothing. |
| Last verified | 10 November 2026 |
Frequently Asked Questions
How do you shorten an IPv6 address?
Can :: be used twice in an IPv6 address?
Should a single 0 group become ::?
Why lowercase?
Next steps