IPv6 Expander and Compressor
Expand an IPv6 address to its full 8-group form, or compress it to the shortest valid representation using :: zero-run collapsing.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
IPv6 Expander and Compressor converts between an IPv6 address’s full 8-group hexadecimal form and its shortest valid compressed form (using :: to collapse the single longest run of consecutive all-zero groups, per RFC 5952’s canonical form rule).
IPv6 addresses can be written in two valid forms: fully expanded (all 8 groups of 4 hex digits, like 2001:0db8:0000:0000:0000:8a2e:0370:7334) or compressed, using :: to collapse a run of consecutive zero groups and dropping leading zeros within each group (like 2001:db8::8a2e:370:7334), both represent the exact same address.
This tool converts cleanly between both forms. Expanding is useful when you need every group explicit (e.g. for a fixed-width parsing script); compressing produces the canonical, shortest form defined by RFC 5952, which most modern tools and logs display by default.
How to use IPv6 Expander and Compressor
- Enter an IPv6 address in either its full or compressed form.
- Read the Expanded (full) and Compressed (shortest) results.
- Copy whichever form your target system or config needs.
- Re-check a suspicious or hand-typed address by confirming both forms parse correctly.
Tips for better results
- Compression always collapses the single longest run of consecutive all-zero groups; if two runs tie for longest, the first one (leftmost) is collapsed, per RFC 5952’s canonical form rule.
- A run must be at least 2 consecutive zero groups to be worth collapsing with ::, a single lone zero group is just written as "0", not "::".
- :: can only appear once in a valid IPv6 address, since using it twice would make the address ambiguous (the parser wouldn’t know how many zero groups each :: represents).
- Leading zeros within a group are always dropped in compressed form (0db8 becomes db8), even when the :: zero-run compression itself isn’t used.
Common use cases
- Converting an IPv6 address to its full form for a script or config expecting fixed-width input.
- Producing the canonical, shortest form of an address for consistent logging or display.
- Verifying two differently-formatted IPv6 addresses actually represent the same underlying address.
- Learning how IPv6’s :: compression notation works with concrete, before-and-after examples.
Common mistakes to avoid
- Writing :: more than once in a single address, which makes it ambiguous and invalid; this tool flags that as an error rather than guessing an interpretation.
- Assuming a single lone zero group should be compressed; RFC 5952’s rule requires at least 2 consecutive zero groups before :: is used.
- Manually comparing two differently formatted addresses character-by-character instead of expanding both first, two addresses that look different as plain text can be identical once expanded.
Frequently asked questions
Can :: appear more than once in an address?
No, a valid IPv6 address can use :: at most once, since using it twice would make it impossible to determine how many zero groups each occurrence represents.
Which form should I use?
Compressed (shortest) form is the RFC 5952 canonical form most tools and systems display by default; expanded (full) form is occasionally needed for fixed-width parsing or explicit documentation.
Does compression always use the longest possible zero run?
Yes, per RFC 5952, the single longest run of consecutive all-zero groups is collapsed; if two runs tie for longest, the leftmost one is used.
Is my IPv6 address sent anywhere?
No, both expansion and compression are pure string/bit manipulation performed entirely in your browser.
Feedback & suggestions
Help us improve IPv6 Expander and Compressor. We read every message.