IPv6 Address Expander and Compressor
CV-26Paste an IPv6 address to write it with all 8 groups of 4 digits, or in its shortest form. It checks the address first and handles an IPv4 ending such as ::ffff:1.2.3.4.
Runs in your browser. Nothing is uploaded.
IPv6 addresses (one per line)
Result
How to use it
- Paste one IPv6 address per line.
- Click Expand for 8 groups of 4 hex digits, or Compress for the short form.
- Tick Uppercase hex digits if you want capital letters. Leave Compress: write ::ffff: addresses with a dotted IPv4 ending ticked to keep that style for mapped addresses.
- Read the result. If an address is invalid, the error says why.
- Copy the result or download it as a text file.
What Expand and Compress do
Expand fills in the zeros that :: stands for and pads every group to 4 hex digits, so ::1 becomes 0000:0000:0000:0000:0000:0000:0000:0001. Compress does the opposite and follows the RFC 5952 text rules: lowercase digits, leading zeros dropped, and :: replacing the longest run of zero groups, the first run if two are the same length. A single zero group is never replaced by ::, so 2001:db8:0:1:1:1:1:1 stays as written.
IPv4 endings
An address can end in a dotted IPv4 part, as in ::ffff:192.0.2.1, which counts as the last two groups. Expand turns that into hex: 0000:0000:0000:0000:0000:ffff:c000:0201. Compress, with the option on, shows a dotted ending only for IPv4-mapped addresses, which are the ones that begin with five zero groups and ffff. Other addresses are written in hex groups.
What is rejected
The checker accepts only hex digits, colons and dots. It rejects more than one ::, groups longer than 4 digits, the wrong number of groups, zone IDs such as %eth0, prefix lengths such as /64 and square brackets, rather than cutting them off silently. An address is only checked for its format. The page does not look anything up or tell you whether it is in use.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"2001:db8::1::2" is not a valid IPv6 address. "::" can appear only once. | The address has two :: markers, so it is unclear how many zero groups each one hides. | Use :: once and write the other zero groups as 0. |
"2001:db8:1" is not a valid IPv6 address. Expected 8 groups separated by colons, found 3. | Without ::, an address needs 8 groups. | Add the missing groups, or use :: to stand in for a run of zero groups. |
"fe80::1%eth0" is not a valid IPv6 address. Zone identifiers such as %eth0 are not supported. | The address has a zone ID after a percent sign. | Remove the % and what follows it, then paste the address again. |
Questions people ask
How do I expand an IPv6 address?
Paste it and click Expand. The page replaces :: with the missing zero groups and pads each group to 4 digits, so 2001:db8::1 becomes 2001:0db8:0000:0000:0000:0000:0000:0001.
How do I shorten an IPv6 address?
Paste the address and click Compress. Leading zeros are dropped, and the longest run of zero groups becomes ::. For example, 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329 in the output.
What is the difference between :: and a single :0:?
RFC 5952 says :: should not replace just one zero group, so 2001:db8:0:1:1:1:1:1 keeps its 0. The page follows that rule when it compresses. When expanding, both forms are read the same way.
What does ::ffff:192.0.2.1 mean?
It is an IPv4-mapped IPv6 address, a way to write an IPv4 address inside the IPv6 format. The last 32 bits hold 192.0.2.1. In hex that is ::ffff:c000:201, and this page can write it either way.
Is the compressed form always the same text?
For one address, Compress gives one result, following the RFC 5952 rules. Other tools may give a longer form that is still valid, which is why comparing addresses as text can mislead you. Expand each address first to compare.
Can it check whether an IPv6 address is valid?
Yes, for format only. If the address breaks a format rule, the error names the problem. A valid format does not say whether the address is assigned or reachable.
About this tool
Checks each address and then writes it either as 8 groups of 4 hex digits (Expand) or in compressed form (Compress). Compress follows the RFC 5952 text rules: leading zeros dropped, lowercase digits, and "::" used for the longest run of zero groups, the first one if two runs tie. A single zero group is never replaced by "::". An embedded IPv4 ending such as ::ffff:1.2.3.4 is accepted and counted as the last two groups. Expand always writes hex groups. With the option on, Compress keeps a dotted IPv4 ending only for IPv4-mapped addresses (::ffff:0:0/96). Zone IDs (%eth0), prefix lengths (/64) and brackets are rejected, not stripped.