About the IPv6 Compressor
This tool produces the canonical shortened IPv6 form: it drops leading zeros from each group and collapses the longest run of all-zero groups to ::, following the recommended rules (RFC 5952). So 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. Using the canonical short form consistently avoids the confusion of the same address written several ways.
The address is expanded and validated first, so malformed input is reported. To go the other way, the IPv6 Expander shows the full form.
RFC 5952 settles the details that the older, looser rules left open. Hex digits are lowercase, leading zeros are dropped from every group, the longest run of all-zero groups is the one that collapses, and when two runs tie for length the leftmost wins. A run of a single zero group is left as 0 rather than collapsed, because :: there saves no characters and reads worse. So 2001:0db8:0000:0000:0001:0000:0000:0001 shortens to 2001:db8::1:0:0:1 and not to 2001:db8:0:0:1::1. Having exactly one spelling per address is what makes it safe to use as a cache key, a deduplication field or a unique index, and it is the reason to normalise on the way into storage rather than at every read.
How to use
- Paste a full or partial IPv6 address.
- Copy the shortest form.
- Swap to expand it again.
Common questions
- Which zero run is collapsed?
- The longest run of all-zero groups, per RFC 5952, and only one run.
- Are leading zeros removed?
- Yes, each group has its leading zeros dropped, so 0db8 becomes db8.
- Is the output canonical?
- Yes, it follows the recommended text representation so the same address always compresses the same way.