IPv6 Compression Tool - Shorten IPv6 Addresses to Short Notation
The IPv6 Compression Tool shortens a full IPv6 address to its correct short notation in one step. Paste a 128-bit address and it strips the leading zeros from each group and collapses the longest run of zero groups into a double colon (
::), returning both the partly shortened and the fully compressed forms with one-click copy. It's built for network engineers, sysadmins, and developers who need clean, consistent IPv6 addresses for configs, DNS records, and documentation. Free to use, no signup required.How to Compress an IPv6 Address
IPv6 compression follows three standard rules to turn a full 128-bit address into its short notation. The value never changes - only the way it's written.
- Rule 1 - Remove leading zeros. In each four-digit group (hextet), drop the zeros at the start.
0db8becomesdb8and0000becomes0. Trailing zeros stay, so2000cannot become2. - Rule 2 - Collapse the longest zero run. Replace the single longest unbroken run of all-zero groups with a double colon (
::). - Rule 3 - Use :: only once. A double colon can appear once per address so it can be expanded back without ambiguity. If two zero runs are the same length, compress the leftmost one.
IPv6 Compression Example
Start with the full address:
2001:0db8:0000:0000:0000:ff00:0042:8329After Rule 1 (leading zeros removed):
2001:db8:0:0:0:ff00:42:8329After Rule 2 (longest zero run collapsed):
2001:db8::ff00:42:8329The tool shows both lines: the partly shortened form and the fully compressed form, each with a copy button.
Working With IPv6 Prefixes (CIDR)
If your address includes a prefix length such as
/64 or /32, enter only the address portion - leave the /prefix off. Compression changes the address, never the prefix length, so you can reattach it to the result. For example, compress 2001:0db8:0000:0000:0000:0000:0000:0000, then write the compressed value as 2001:db8::/64.Why Compress IPv6 Addresses?
- Readable configs. A full 128-bit address is long and error-prone to type or read. Short notation makes router, firewall, and server configs easier to scan and harder to mistype.
- Consistency across systems. Writing every address the same compressed way keeps docs, dashboards, and tickets aligned, so the same host is always recognizable.
- Cleaner logs and UI. Compressed addresses take less space in log lines, tables, and admin panels, which makes them easier to spot and compare.
- Faster than compressing by hand. Applying the zero-removal and zero-run rules manually is slow and easy to get wrong. The tool returns the correct short notation instantly. For programmatic IPv6 work at scale, the IP Geolocation API takes any IPv4 or IPv6 address - or a hostname - and returns its location, network and ASN, and threat data in a single REST call.
FAQs
IPv6 compression is the standard way to write a 128-bit IPv6 address in a shorter form without changing its value. It removes the leading zeros inside each four-digit group and replaces the longest single run of all-zero groups with a double colon (
::). The result is the same address in IPv6 short notation.Go through the eight groups in order. First drop the leading zeros in every group, so
0db8 becomes db8 and 0000 becomes 0. Then find the longest unbroken run of 0 groups and replace it with ::. Use :: only once, and if two runs are the same length, compress the leftmost one.The most compressed form has no leading zeros in any group and the single longest run of zero groups replaced by
::. For example, 2001:0db8:0000:0000:0000:ff00:0042:8329 fully compresses to 2001:db8::ff00:42:8329. There is only one correct fully compressed form for any address.The tool returns two formats. "Compressed IPv6 (Shortened)" shows the address after only the leading zeros are removed - for example
2001:db8:0:0:0:ff00:42:8329. "Compressed IPv6" shows the fully compressed form with the zero run collapsed to :: - 2001:db8::ff00:42:8329. Each result has a copy button, so you can take whichever notation your system expects.No. Compression only changes how the address is written. The underlying 128-bit value is identical, so the compressed and expanded forms are interchangeable in configs, DNS records, and code.
Enter only the address portion, without the
/prefix. The tool compresses the address itself, and the prefix length never changes during compression - so you can reattach it to the result. Compress 2001:0db8:0000:0000:0000:0000:0000:0000, then write it as 2001:db8::/64.Compression is fully reversible. To restore the full 128-bit form, add the leading zeros back to each group and replace the
:: with the right number of 0000 groups. The IPv6 Expander does it instantly.