IPv6 Expander & Compressor
Paste one IPv6 address or a whole list. Each one is validated, expanded to all eight 4-digit groups and compressed to the canonical RFC 5952 form, with zone IDs, prefix lengths and embedded IPv4 addresses kept intact.
Last updated:
| Input | Status | Compressed (RFC 5952) | Expanded | Type |
|---|
Address details
How to use the IPv6 Expander & Compressor
- Paste IPv6 addresses, one per line. Brackets, ports, zone IDs and /prefix lengths are accepted.
- Press Compress All for the shortest canonical form or Expand All for the full 39-character form.
- Check the table for each address's validity, both forms, its type and reverse DNS name.
- Choose the IPv4 option to write IPv4-mapped and NAT64 addresses with a dotted IPv4 tail, as RFC 5952 recommends.
- Copy or download the converted list or the full table as CSV.
RFC 5952 compression rules
- Drop leading zeros in every group:
0db8→db8,0000→0. - Use :: for the longest run of two or more consecutive zero groups.
- If two runs tie, shorten the first one.
- Never use :: for a single zero group.
- Write hex letters in lowercase.
| Full form | Canonical compressed form | Rule |
|---|---|---|
2001:0db8:0000:0000:0000:ff00:0042:8329 | 2001:db8::ff00:42:8329 | leading zeros + longest run |
2001:0db8:0000:0000:0001:0000:0000:0001 | 2001:db8::1:0:0:1 | tie: first run wins |
2001:0000:0000:0001:0000:0000:0000:0001 | 2001:0:0:1::1 | longest run wins |
2001:0db8:0000:0001:0001:0001:0001:0001 | 2001:db8:0:1:1:1:1:1 | single zero group stays |
0000:0000:0000:0000:0000:0000:0000:0001 | ::1 | loopback |
0000:0000:0000:0000:0000:0000:0000:0000 | :: | unspecified address |
2001:0DB8:0000:0000:0000:0000:0000:000A | 2001:db8::a | lowercase |
0000:0000:0000:0000:0000:ffff:c000:0280 | ::ffff:192.0.2.128 | IPv4-mapped, dotted tail (§5) |
How expansion works
An IPv6 address is 128 bits written as eight 16-bit groups. To expand fe80::1:2: there are 3 written groups (fe80, 1, 2), so :: stands for 8 − 3 = 5 zero groups. Padding each group to four digits gives fe80:0000:0000:0000:0000:0000:0001:0002. The full form is always 39 characters (32 hex digits and 7 colons), which makes it handy for sorting, database keys and string comparison.
With an embedded IPv4 tail the last two groups come from the four IPv4 octets: 192.0.2.128 → (192 × 256 + 0) = 0xc000 and (2 × 256 + 128) = 0x0280.
Special IPv6 address ranges
| Prefix | Type |
|---|---|
::/128, ::1/128 | Unspecified, loopback |
::ffff:0:0/96 | IPv4-mapped addresses |
64:ff9b::/96 | NAT64 IPv4/IPv6 translation |
2000::/3 | Global unicast (the public internet) |
2001::/32, 2002::/16 | Teredo, 6to4 transition |
2001:db8::/32 | Documentation and examples |
fc00::/7 | Unique local addresses (private, like RFC 1918) |
fe80::/10 | Link-local (needs a zone ID such as %eth0) |
ff00::/8 | Multicast (ff02:: = link-local scope) |
Writing IPv6 in URLs and with ports
Because colons separate the groups, an IPv6 address in a URL must be in square brackets: https://[2001:db8::a]:8443/. A zone ID in a URL is written as %25 (RFC 6874), for example http://[fe80::1%25eth0]/. The tool accepts both forms and strips the brackets and port before converting.
Frequently asked questions
How do you compress an IPv6 address?
RFC 5952 defines one canonical form: write hex digits in lowercase, drop leading zeros in every group, and replace the longest run of two or more all-zero groups with ::. If two runs are equally long, the first one is shortened. A single zero group stays as 0.
How do you expand an IPv6 address?
Replace :: with as many 0000 groups as needed to make eight groups in total, then pad every group to four hex digits. 2001:db8::1 becomes 2001:0db8:0000:0000:0000:0000:0000:0001.
Why is 2001:db8:0:1:1:1:1:1 not shortened?
The :: shorthand must not be used for a single 16-bit zero group (RFC 5952, section 4.2.2), so the canonical form keeps the 0. Some older tools still write 2001:db8::1:1:1:1:1, which is valid but not canonical.
What is a zone ID like %eth0?
Link-local addresses (fe80::/10) exist on every interface, so a zone ID after % tells the operating system which interface to use, for example fe80::1%eth0 or fe80::1%3 on Windows. The tool keeps the zone ID unchanged in both forms.
Can I use IPv4 notation inside IPv6?
Yes. The last 32 bits may be written as a dotted IPv4 address, as in ::ffff:192.0.2.128 (IPv4-mapped) or 64:ff9b::198.51.100.7 (NAT64). The expanded form always shows pure hex: 0000:0000:0000:0000:0000:ffff:c000:0280.
Which addresses are rejected?
Addresses with more than one ::, more or fewer than eight groups, groups longer than four hex digits, non-hex characters, an invalid embedded IPv4 part, an empty zone ID or a prefix length above 128. The table explains the exact problem.
Is my data sent anywhere?
No. Validation and conversion run entirely in your browser.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.