Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / IP addresses / IPv6 Compression & Expansion

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.

The rules for shortening an IPv6 address

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.

1. Drop leading zeros

In each group: 0db8 becomes db8, 0042 becomes 42, 0000 becomes 0.

2. Replace one run of zeros

The longest run of all-zero groups becomes ::. Only once per address, or it would be ambiguous.

3. Break ties to the left

With two runs of equal length, the first one is shortened. A single zero group is never replaced.

4. Lower case

Hex digits a–f are written in lower case.

Why the standard form matters

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.

Frequently asked questions

How do I shorten an IPv6 address?

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.

Why can "::" be used only once?

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.

How do I expand an IPv6 address?

Replace "::" with enough zero groups to make eight in total, then pad every group to four digits with leading zeros.

What is the reverse DNS name of an IPv6 address?

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.

Related free tools

The same server, written five ways in five config files.

Upzilla watches it under any spelling and alerts you when it stops answering. 10 monitors free.

Start monitoring free →