IPv6 Compress & Expand
One address per line. Converted in your browser as you type.
3 of 3 lines are valid IPv6 addresses.
- Compressed (RFC 5952)
2001:db8::ff00:42:8329
Expanded2001:0db8:0000:0000:0000:ff00:0042:8329
- Compressed (RFC 5952)
2a00:1450:4010:c0b::64
Expanded2a00:1450:4010:0c0b:0000:0000:0000:0064
- Compressed (RFC 5952)
::ffff:192.0.2.1
Expanded0000:0000:0000:0000:0000:ffff:c000:0201
An IPv6 address has 128 bits, written as eight groups of four hexadecimal digits. Almost nobody writes all 32 digits: leading zeros in a group may be dropped, and one run of all-zero groups may be replaced by ::.
Because several short forms are possible, RFC 5952 defines one canonical form that every tool should output: lower-case hex, no leading zeros, :: used for the longest run of two or more zero groups (the first one if there is a tie), and never for a single zero group. 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329.
The expanded form, with all eight groups and every leading zero, is what you need for sorting text, for some configuration files and for building reverse DNS names (ip6.arpa).
Frequently asked questions
Why does :: appear only once?
Because two :: would be ambiguous: in 2001::1::2 nobody could tell how many zero groups each one stands for.
Are upper-case letters wrong?
They are valid input, but RFC 5952 asks for lower case in output, so logs, configuration and comparisons stay consistent.
What about addresses with an IPv4 part, like ::ffff:192.0.2.1?
They are accepted. The compressed output keeps the dotted IPv4 part for IPv4-mapped addresses, as RFC 5952 recommends.