IPv6 addresses are long, so they are usually written in a shortened form: leading zeros are dropped and one run of zero groups is replaced by a double colon. That shorthand is convenient for humans but awkward for configuration files, firewall rules, and log analysis, where the full 128-bit form is often clearer. This tool converts in both directions. Paste a compressed address such as 2001:db8::1 and see all eight groups written out in full, or paste a full address and get the shortest valid compressed form back, with every step done in your browser and nothing sent to a server.
Quick Answer: Enter an IPv6 address, click Expand for the full eight-group form or Compress for the shortest valid shorthand.
Free Online Tool
IPv6 Expander / Compressor
Expand compressed IPv6 to full form, or compress a full address back to short form.
How to Use the IPv6 Expander / Compressor
- Paste or type an IPv6 address into the input box, compressed or full.
- Click Expand to see all eight groups, each padded to four hex digits.
- Click Compress to shrink a full address using the standard double-colon rule.
- Copy the result and paste it into your config, rule, or documentation.
- If you see an error, check for a second double colon or a group with more than four digits.
- Use the Clear button to reset the tool before the next address.
Key Features
- Both directions: expansion and compression in one tool.
- Validates group count, hex digits, and double-colon placement.
- Pads every group to four digits in expanded form.
- Compresses only the longest run of zero groups, per the standard.
- Runs entirely in your browser; no address ever leaves your device.
- Handles the all-zero address and the loopback address correctly.
What the Result Means
The expanded form shows the address exactly as the network sees it: eight 16-bit groups, 128 bits in total. The compressed form is the same address written shorter, never a different address. If expansion fails, the input is not a valid IPv6 address: the usual causes are two double colons, nine groups, or a non-hex character. A compressed address with no double colon must already have eight groups; a double colon may appear only once and stands for one or more groups of zeros.
Worked Example
Take 2001:db8:0:0:1:0:0:1. Expanding it changes nothing except padding: every group becomes four digits, giving 2001:0db8:0000:0000:0001:0000:0000:0001. Compressing that full form finds two zero runs, one of length two and one of length three, and replaces the longer one, producing 2001:db8:0:0:1::1. The remaining run of two zeros stays written out, because only one double colon is allowed. If you compress again you get the same result, which confirms the form is canonical.
Best Practices and Tips
- Keep the documentation prefix 2001:db8::/32 for examples; it is reserved and will never route on the public internet.
- When comparing addresses from logs, expand both first so formatting differences cannot hide a match.
- In firewall rules, prefer the compressed form for readability but test the expanded form when a rule seems not to match.
- Remember that IPv6 hex is case-insensitive: 2001:DB8::1 and 2001:db8::1 are the same address.
- If a tool rejects your address, expand it here first to find the malformed group.
Common Mistakes to Avoid
- Using two double colons in one address, which is never valid.
- Writing a group with five hex digits, which exceeds 16 bits.
- Assuming the compressed and expanded forms are different addresses.
- Forgetting that :: can stand for a single zero group as well as several.
Frequently Asked Questions
What does :: actually mean?
It stands for one or more consecutive groups of zeros, and it may appear only once in an address. The reader fills in enough zero groups to reach eight in total.
Why does compression pick the longest zero run?
The standard says the longest run of zero groups is replaced, so every address has one canonical shortest form. Ties are broken by taking the first longest run.
Is the expanded form the same address?
Yes, exactly. Expansion and compression only change notation. The 128-bit value underneath is identical.
What about IPv4-mapped IPv6 addresses?
Addresses such as ::ffff:192.0.2.1 mix notations and are outside this tool. Convert the IPv4 part separately and write the last 32 bits as two hex groups.
