IPv6 compressor / expander
Compress IPv6 addresses to the shortest `::` form or expand them to all 8 groups, with leading-zero and prefix-length handling.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Type an IPv6 address to compress and expand it
What this tool does
- Compress a fully written address such as 2001:0db8:0000:0000:0000:ff00:0042:8329 into the canonical shortest form before pasting it into device config, DNS records or firewall rules.
- Expand the :: shorthand you see in logs and packet captures so you can read all eight groups and match them against your subnets.
- Check whether two IPv6 addresses are really the same: in expanded form you can compare group by group instead of counting how many zero groups :: hides.
- Normalise case and leading zeros: addresses copied from different systems (uppercase, padded) are rewritten into the RFC 5952 lowercase form before you store them.
Example
Input
2001:0db8:0000:0000:0000:ff00:0042:8329
Output
Compressed 2001:db8::ff00:42:8329 Expanded 2001:db8:0:0:0:ff00:42:8329 Full (4-digit groups) 2001:0db8:0000:0000:0000:ff00:0042:8329
Add a /64 to the input and two more rows appear: compressed + prefix and expanded + prefix. For example fe80::1/64 yields fe80::1/64 and fe80:0:0:0:0:0:0:1/64.
Frequently asked questions
Why is only one run of zeros compressed?
RFC 5952 allows a single :: for the longest run of zero groups, and that run must be at least two groups long. In 2001:db8:0:ff00:0:0:42:8329 the lone zero is not compressed, because :: would have to stand for at least two groups.
What happens to uppercase letters and leading zeros?
Hex letters are always emitted in lowercase, as RFC 5952 recommends, and leading zeros are dropped in the compressed and expanded forms. Only the "full" row keeps four digits per group, which is what you want when comparing against logs or vendor documentation character by character.
Does it handle embedded IPv4 such as ::ffff:192.168.1.1?
Yes. The embedded IPv4 part (which must be at the end of the address) is converted into two hexadecimal groups, so ::ffff:192.168.1.1 expands to ::ffff:c0a8:101. That mixed notation is very common in logs.
Which inputs are rejected?
Fewer than eight groups without ::, more than one ::, a group longer than four hex digits, characters outside 0–9a–f, and prefix lengths that are not integers between 0 and 128 all fail. An address without a prefix still parses fine, it just does not produce the two prefixed rows.
Is the conversion local?
Yes. It is pure string parsing and formatting in your browser, no network request is made, it works offline, and the addresses you enter are never recorded.
Keywords:ipv6压缩展开compressexpand地址rfc 5952前缀prefix