Guide
Expanding shortened IPv6 addresses to their full form
IPv6 addresses are easy to misread. The same address can be written many ways, and the shortcuts that make them tidy, leading zeros dropped and a double colon in place of a run of zeros, hide how many digits are really there. Expanding an address to its full 39-character form removes the ambiguity. This page does it for a list of addresses at once.
What expansion does
A full IPv6 address has eight groups of four hexadecimal digits separated by colons. Two shortcuts are allowed. Leading zeros inside a group can be omitted, so 0db8 becomes db8 and 0000 becomes 0. And one run of consecutive all-zero groups can be replaced by ::. Expansion reverses both: it pads each group to four digits, counts the groups that are present, and fills the gap at :: with as many 0000 groups as are needed to reach eight. The standard that defines the text forms is RFC 4291, with the recommended canonical shortening in RFC 5952.
Input the page understands
Besides ordinary addresses, it accepts an IPv4 address in the last 32 bits (::ffff:192.0.2.1), converting the dotted part to two hexadecimal groups; a zone identifier such as %eth0, which names the interface for link-local addresses; and square brackets, as used in URLs. Each line is handled separately, so a pasted list can mix styles. A line that is not a valid address is reported with a clear message instead of producing a guess, and a switch lets you choose upper or lower case for the digits.
Why you need the long form
Text comparison only works on one spelling. Searching a log for 2001:db8::1 will miss 2001:0db8:0:0:0:0:0:1. Reverse DNS names for IPv6 are built from all 32 hexadecimal digits written backwards, one per label, so every digit must be present. Firewall and ACL syntaxes from some vendors want the full form, and spreadsheets sorting addresses as text need fixed width to keep the order right. Expanding first, then comparing or sorting, is the dependable approach.
A worked example
The sample list contains six addresses. 2001:db8::1 becomes 2001:0db8:0000:0000:0000:0000:0000:0001. ::1, the loopback address, becomes 0000:0000:0000:0000:0000:0000:0000:0001. fe80::1ff:fe23:4567:890a becomes fe80:0000:0000:0000:01ff:fe23:4567:890a. The mapped address ::ffff:192.0.2.1 becomes 0000:0000:0000:0000:0000:ffff:c000:0201, because 192.0 is c000 and 2.1 is 0201. All six outputs are 39 characters long.
Limits
The page expands the address only. A prefix length such as /64 is not part of the result; keep it separately or use the IPv6 Subnet Calculator when you need the range the prefix describes. It does not check that an address is assigned, routed or reachable, only that its text is a legal IPv6 address.
Doing it by hand
To expand an address manually, count the groups that are written. Take 2001:db8::1: it shows three groups, so the double colon hides five all-zero groups. Write the three groups, insert five groups of 0000 in the position of the ::, and pad every group on the left with zeros to four digits: 2001:0db8:0000:0000:0000:0000:0000:0001. Checking that the result has eight groups of four digits, 39 characters in all, is a reliable test that you filled the gap correctly.
Related tools
- IPv6 Compressor does the reverse and writes the canonical short form.
- IPv6 Subnet Calculator works out the range and /64 networks of a prefix.
- IPv4 to IPv6 Converter shows mapped, NAT64 and 6to4 forms of an IPv4 address.
- Reverse DNS Zone Generator builds the ip6.arpa names that need the full form.
Checked against the current version of the IPv6 Expander on .

