IPv6 address expander and compressor

Normalises how an IPv6 address is written before you put it in a firewall rule, a DNS record or compare it in a sheet.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter ipv6 address.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Expand: replace :: with the missing zero groups and pad each group to 4 digits. Compress (RFC 5952): drop leading zeros, replace the longest run of 2+ zero groups with :: (the first on a tie), lowercase.

Example

Inputs: IPv6 address = 2001:0DB8:0000:0000:0001:0000:0000:0001. Result: Compressed (RFC 5952): 2001:db8::1:0:0:1.

2001:0DB8:0000:0000:0001:0000:0000:0001
2001:db8::1:0:0:1

Limits and caveats

  • Zone ids such as %eth0 and prefix lengths such as /64 are not accepted; remove them first.
  • IPv4-mapped addresses are shown in mixed notation, as RFC 5952 recommends.

Questions about this tool

Can :: appear more than once?

No. That would make the number of zero groups ambiguous, so the tool rejects it.

Why is a single zero group not shortened?

RFC 5952 says :: must not stand for just one zero group, so it stays as 0.

What is the ip6.arpa name for?

You need it to create a PTR record so the address resolves back to a hostname.