DNS Checker.eu

IPv6 Compression

Compress any IPv6 address into its canonical shortest form under RFC 5952 - leading zeros dropped, the longest zero run collapsed to ::, lowercase hex.

Compress an IPv6 address

Produces the canonical short form per RFC 5952: leading zeros dropped, the longest run of zero groups collapsed to ::, lowercase hex.

About IPv6 Compression

An IPv6 address is 128 bits written as eight groups of four hexadecimal digits, but that full form is verbose and hard to read. Compression shortens it without changing its value. This tool applies the canonical rules defined in RFC 5952 so that a given address always produces one agreed-upon short form, rather than one of several equivalent styles.

Three rules do the work. Leading zeros inside each 16-bit group are removed, so 0db8 becomes db8 and 0001 becomes 1. The single longest run of consecutive all-zero groups is replaced by a double colon (::), which stands in for those groups. And all hexadecimal letters are written in lowercase. The result is the compact form you should store in configuration, print in documentation, and compare against.

A couple of details trip people up, and the tool follows the standard on both. The :: shorthand may appear at most once in an address, because two of them would be ambiguous about how many zero groups each represents. And a single lone zero group is written as 0 rather than being collapsed to ::, since :: is only meant to shorten runs of two or more zero groups. When two zero runs are equally long, the leftmost one is compressed.

The tool accepts input in any notation - fully expanded, partially shortened, uppercase, or with a trailing embedded IPv4 suffix - and normalizes it. Compression runs entirely client-side in your browser with no network request, so pasting an address here never transmits it. It is part of a self-hosted European toolkit built without third-party trackers.

How to use it

  1. 1Paste an IPv6 address in any form into the input, for example 2001:0db8:0000:0000:0000:0000:0000:0001.
  2. 2The tool parses and validates the address as you type, accepting upper- or lowercase and embedded IPv4.
  3. 3Read the compressed RFC 5952 form, such as 2001:db8::1, in the result box.
  4. 4Use the copy button to place the canonical short form into your config, DNS record, or documentation.

Common use cases

  • -Normalizing addresses to one canonical spelling before storing them in a database or config file.
  • -Making long addresses readable in documentation, dashboards, and network diagrams.
  • -Ensuring log lines and access rules use a consistent form so string comparisons match.
  • -Cleaning up addresses copied from tools that emit the fully padded 32-digit notation.
  • -Learning the RFC 5952 rules by watching how each expanded address collapses.

Frequently asked questions

How do I shorten an IPv6 address?
Remove the leading zeros from each group, replace the longest run of consecutive zero groups with ::, and write the hex in lowercase. For example 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1. This tool applies those RFC 5952 rules automatically.
What are the rules for IPv6 compression?
RFC 5952 defines three: drop leading zeros within each 16-bit group, collapse the single longest run of all-zero groups to ::, and use lowercase hexadecimal. The :: may appear only once, and a lone zero group is written as 0, not ::.
Can :: appear twice in an IPv6 address?
No. The double colon may be used at most once per address, because two of them would make it impossible to tell how many zero groups each one represents. This tool always produces a single, unambiguous ::.
Is 2001:db8:0:0:0:0:0:1 the same as 2001:db8::1?
Yes, they are the same address written two ways. Compression only changes the text, not the 128-bit value, so both refer to exactly the same host. The canonical form is 2001:db8::1.
Should IPv6 addresses use uppercase or lowercase letters?
RFC 5952 requires lowercase for the hexadecimal digits a through f in the canonical form. Uppercase is still a valid address, but lowercase is the standard representation this tool produces.
Does compressing an address here send it anywhere?
No. The compression runs entirely in your browser, so the address you paste is never uploaded. That keeps internal or sensitive addresses on your own device.