IPv6 Compressor

Compress any full or expanded IPv6 address into its shortest, RFC 5952-compliant form. Paste something like 2001:0db8:0000:0000:0000:0000:0000:0001 and this tool returns 2001:db8::1 โ€” completely in your browser.

What Is IPv6 Compression?

IPv6 addresses are 128 bits long and are normally written as eight groups of four hexadecimal digits separated by colons, such as 2001:0db8:0000:0000:0000:0000:0000:0001. That full form is long and error-prone to type, so the standard defines two compression rules. First, leading zeros within each group can be dropped, so 0db8 becomes db8. Second, one contiguous run of all-zero groups can be replaced with a double colon (::), collapsing a long stretch of zeroes into just two characters.

An IPv6 compressor applies these rules automatically to produce the shortest valid representation of an address. The result follows RFC 5952, the standard that governs how IPv6 addresses should be written: lowercase letters, no leading zeros, and the longest run of zero groups compressed to :: (with the first such run chosen when there is a tie). This is the form you should use in configuration files, DNS records, firewall rules and documentation.

How to Use This Tool

The tool is completely free, requires no account, and processes your address entirely on your own device โ€” nothing you type is sent to any server. If you need the reverse operation, use the IPv6 Expander to turn a compressed address back into its full form.

IPv6 Compressor โ€” Frequently Asked Questions

What are the rules for compressing an IPv6 address?

Two rules apply. Leading zeros in each group can be removed, so 0db8 becomes db8. And a single contiguous run of all-zero groups can be replaced by ::. RFC 5952 adds that the longest run of zeroes should be compressed, and that the first such run is chosen when two runs are equally long.

Why can the double colon appear only once?

The :: shorthand stands for an unknown number of zero groups. If it appeared twice, there would be no way to know how many zeroes each marker represents, so the address would be ambiguous and invalid. A compressor must therefore collapse at most one run of zeroes.

Is the compressed form always lowercase?

Yes. RFC 5952 requires that IPv6 addresses be written in lowercase hexadecimal. This compressor always outputs lowercase, which keeps addresses consistent and avoids the confusion that mixed-case addresses can cause in logs and configuration files.

What is the compressed form of the loopback address?

The IPv6 loopback address ::1 is already in its shortest form. Its full expansion is 0000:0000:0000:0000:0000:0000:0000:0001, and compressing that full form correctly returns ::1.

Is this IPv6 compressor free and private?

Yes. This tool is entirely free and runs completely in your browser. The compression is done locally in JavaScript, so the IPv6 address you enter is never transmitted to any server, logged, or stored anywhere.