PUBLIC.INTERNET

IPv6 Address Compressor

Paste an IPv6 address, choose Compress or Expand, and the page gives you the other notation. Compression drops leading zeros from each group and replaces the longest run of all-zero groups with ::. Expansion restores all eight groups padded to four hex digits. Both forms are shown together with a guess at the address type and a count of leading zeros dropped from the groups. Input is case-insensitive, but IPv4-embedded forms like ::ffff:192.0.2.1, zone IDs, and prefix lengths are rejected.

Enter a full or compressed IPv6 address

How to compress or expand an IPv6 address

  1. Click Compress or Expand under Operation Mode. The action button and the format hint change to match.
  2. Enter the address in IPv6 Address, either fully written like 2001:0db8:0000:0000:0000:ff00:0042:8329 or already shortened like 2001:db8::ff00:42:8329.
  3. Click Compress Address or Expand Address. The Original box echoes your input and the result box below shows the Compressed or Expanded form, with a Copy to Clipboard button.
  4. Check Address Details for the full notation, the compressed notation, the address type, and how many leading zeros were removed. Invalid input (two ::, too many groups, non-hex characters, a /64 suffix) shows an error.

Why :: can appear only once, and how the longest run is picked

:: stands for however many all-zero groups are needed to reach eight. If it appeared twice, a parser could not tell how many groups each one covers, so the address would be ambiguous and is invalid. RFC 5952, the recommended text format, defines a canonical form: lowercase hex, no leading zeros, the longest run of zero groups replaced with ::, the first run chosen on a tie, and no :: for a single zero group.

That is why 2001:db8:0:0:1:0:0:1 compresses to 2001:db8::1:0:0:1: both zero runs are two groups long, and the earlier one wins. Canonical output matters when you compare addresses as text, grep logs, or write firewall rules, because one address has many legal spellings and a plain string match only finds one of them.

The Address Type field is a prefix lookup on the first group. It recognizes loopback (::1), unspecified (::), link-local fe80, multicast ff, unique local fc and fd, documentation 2001:db8, and NAT64 64:ff9b, and calls anything starting with 2 or 3 Global Unicast. It is a quick label only: link-local matches when the first group is exactly fe80, so the rest of fe80::/10 shows as Reserved / Other.