IPv6 Address Compression Calculator
Compress a full IPv6 address to its shortest RFC 5952 form and see exactly how many characters are saved.
Inputs
Compressed Address
2001:db8::ff00:42:8329
Expanded Address
2001:0db8:0000:0000:0000:ff00:0042:8329
Characters Saved
17
Zero Groups Collapsed
3
Step by step
Values used
IPv6 address = 2001:0db8:0000:0000:0000:ff00:0042:8329
IPv6 Address Compression
Leading zeros in each group are dropped and the longest run of all-zero groups (two or more) is replaced by '::'.
Compressed Address
= 2001:db8::ff00:42:8329
Expanded Address
= 2001:0db8:0000:0000:0000:ff00:0042:8329
Characters Saved
= 17
Zero Groups Collapsed
= 3
How it works
RFC 5952 defines one canonical text form: lowercase hex, no leading zeros inside a group, and a single '::' replacing the longest zero run. Ties are resolved in favour of the leftmost run. Two spellings of the same address break string comparisons in ACLs, allow-lists and log correlation, so normalising to the canonical form removes a whole class of false negatives.
Formula
IPv6 Address Compression
Leading zeros in each group are dropped and the longest run of all-zero groups (two or more) is replaced by '::'.
- ::
- Placeholder for the single longest run of zero groups
Frequently Asked Questions
How is IPv6 Address Compression calculated?
Leading zeros in each group are dropped and the longest run of all-zero groups (two or more) is replaced by '::'. RFC 5952 defines one canonical text form: lowercase hex, no leading zeros inside a group, and a single '::' replacing the longest zero run. Ties are resolved in favour of the leftmost run.
Why does IPv6 Address Compression matter?
Two spellings of the same address break string comparisons in ACLs, allow-lists and log correlation, so normalising to the canonical form removes a whole class of false negatives.
What values do I need to enter?
This calculator takes 1 input: IPv6 address. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.