IPv6 Compression & Expansion
Paste an IPv6 address in any spelling. Get the shortest standard form, the fully written-out form, the address type and the reverse DNS name.
Runs entirely in your browser — nothing you enter here is sent to a server.
Paste an IPv6 address in any spelling. Get the shortest standard form, the fully written-out form, the address type and the reverse DNS name.
Runs entirely in your browser — nothing you enter here is sent to a server.
An IPv6 address is eight groups of four hexadecimal digits. Written in full it is 39 characters, most of them often zeros, so two shortcuts are allowed — and RFC 5952 says exactly how to apply them so that everyone writes the same address the same way.
In each group: 0db8 becomes db8, 0042 becomes 42, 0000 becomes 0.
The longest run of all-zero groups becomes ::. Only once per address, or it would be ambiguous.
With two runs of equal length, the first one is shortened. A single zero group is never replaced.
Hex digits a–f are written in lower case.
All spellings of an address are equally valid to a computer, and that is the problem: 2001:DB8:0:0:0:0:0:1, 2001:db8::1 and 2001:0db8::0001 are the same host, but a text search for one will not find the others. Log analysis, allowlists kept as strings, config diffs and spreadsheets all break quietly on this. Normalise addresses to the compressed form when you store them, and compare them as addresses rather than as text when you can.
The expanded form has its uses too: it is what you need to build a reverse DNS (ip6.arpa) record, where every one of the 32 digits appears, reversed and separated by dots.
Remove the leading zeros in each group, then replace the longest run of consecutive all-zero groups with "::". 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329.
It stands for "as many zero groups as are missing". With two of them there would be no way to tell how many zeros each one replaces.
Replace "::" with enough zero groups to make eight in total, then pad every group to four digits with leading zeros.
The 32 hex digits of the expanded address, in reverse order, separated by dots, followed by ip6.arpa. This tool writes it out for you.
Upzilla watches it under any spelling and alerts you when it stops answering. 10 monitors free.