IPv6 Expander / Compressor
ConverterExpand IPv6 addresses to their full 8-group form, or compress them to the shortest RFC 5952-compliant form. Runs entirely in your browser.
About this tool
About IPv6 Expander / Compressor
IPv6 addresses are 128 bits, normally written as 8 groups of 4 hex digits separated by colons. To keep addresses readable, RFC 5952 allows compressing consecutive all-zero groups into a single '::', and dropping leading zeros within each group. This tool converts an IPv6 address between its full, uncompressed form and its shortest, standards-compliant compressed form.
Expansion splits the address on ':', detects a '::' run and inserts the correct number of zero groups to reach 8 total, then pads each group to 4 hex digits. Compression finds the longest run of consecutive all-zero groups (at least 2, per RFC 5952 — a single zero group is never compressed), replaces just that one run with '::', and strips leading zeros from the remaining groups. When multiple equally-long zero runs exist, the first one is compressed, matching the RFC 5952 tie-breaking rule.
Use this to expand a compressed IPv6 address for a firewall rule, log entry, or configuration file that requires the full form, or to compress a verbose IPv6 address into the shorter form used in documentation, command-line tools, or URLs.
Instant, fully client-side conversion with no data ever leaving your browser. The compression logic follows RFC 5952's canonical form rules exactly, including the tie-breaking rule for multiple equal-length zero runs, so the output matches what any standards-compliant tool would produce.
Key Features
- Two-way conversion — expand to full form or compress to shortest form
- RFC 5952-compliant: only compresses runs of 2+ zero groups, never a single one
- Correct tie-breaking when multiple equal-length zero runs exist
- Clear error messages for malformed addresses
- One-click copy to clipboard
- 100% browser-based, no data ever transmitted
FAQ
IPv6 Expander / Compressor — Frequently Asked Questions
What does it mean to 'expand' an IPv6 address?
An IPv6 address always has 8 groups of 16 bits each, written as 4 hex digits. Expanding fills in any groups that were compressed away with '::' and pads every group's leading zeros back in, giving you the full, unambiguous 8-group form.
Why does '::' only compress runs of 2 or more zero groups?
RFC 5952, the standard for IPv6 text representation, specifically prohibits using '::' to replace a single zero group — for example, '2001:db8:0:1:1:1:1:1' should stay as-is, not become '2001:db8::1:1:1:1:1', because that wouldn't actually shorten the address and could create ambiguity in some contexts.
What happens if there are two equal-length runs of zero groups?
RFC 5952 requires compressing the first (leftmost) run when there's a tie. For example, '2001:db8:0:0:1:0:0:1' has two runs of two zero groups each — the correct compressed form is '2001:db8::1:0:0:1', compressing the first run only.
Can I use '::' more than once in an address?
No. An IPv6 address can contain at most one '::', because if there were two, there would be no way to determine how many zero groups each one represents. This tool rejects addresses with more than one '::'.
Why does my address fail to convert?
The most common causes are more than 8 groups (or too few without a '::' to account for the difference), a group with more than 4 hex digits, or a character that isn't a valid hex digit (0-9, a-f).
Tips
- A single zero group (like the middle of 2001:db8:0:1::1) is never compressed to '::' — only runs of 2 or more
- If your address has multiple equal-length zero runs, the leftmost one gets compressed per RFC 5952
- An address can contain at most one '::' — if you have two, one of them needs to be written out with explicit zero groups
- This converter never sends your IPv6 address anywhere — everything happens entirely in your browser
Explore more
Related Tools
Other tools that might be useful for your workflow