IPv6 Compress / ExpandInternet Tools
Shorten IPv6 addresses (RFC 5952) or expand them in full.
2001:0db8:0000:0000:0000:ff00:0042:8329 and 2001:db8::ff00:42:8329 are the same address. Two rules shorten it, one rule limits where :: can go, and some systems still need the long form back.
An IPv6 address is 128 bits, written as eight groups of four hex digits. The same address can be written with or without leading zeros, in upper or lower case, and with or without ::. Searching logs, comparing firewall rules, or matching DNS records as text fails when two systems spell the address differently.
RFC 5952 fixes one form for each address, the one to use in documentation and logs. Some systems want the opposite: reverse DNS zones and some firewalls need all 32 hex digits.
The IPv6 Compress / Expand tool takes one address or a list, one per line. It reads each address into its 128 bits first, so any valid spelling gives the same result, then writes it in RFC 5952 form or in full. Invalid lines are marked and explained. A prefix such as /64 or a zone index such as %eth0 makes a line invalid, so remove those first.
For an address with a prefix, the IPv6 CIDR Calculator shows the network, the first and last address, and the exact count, in full and compressed form. 2001:db8::/64 holds 18,446,744,073,709,551,616 addresses, and a /48 holds 65,536 /64 subnets.
::. If two runs are the same length, shorten the first one.::.:: can appear only once. An address with two is invalid, because nobody could tell how many zero groups each one stands for.Lowercase hex, no leading zeros in a group, and the longest run of two or more zero groups written as ::.
No. Two would make the address ambiguous, so it is invalid.
Write all eight groups with four digits: 0000:0000:0000:0000:0000:0000:0000:0001.
As 2001:db8::1:0:0:1. The two zero runs are the same length, so the first one is shortened.
Tools used in this guide
Shorten IPv6 addresses (RFC 5952) or expand them in full.
First and last address, size, and type of any IPv6 prefix.