Why IPv6 addresses need compressing
A full IPv6 address is eight groups of four hexadecimal digits: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 — 39 characters before you have typed anything else. Fortunately the notation has two legal shortcuts, and applying them properly is exactly what this tool does:
- Drop leading zeros in each group — 0db8 becomes db8, 0370 becomes 370, 0000 becomes 0.
- Replace one run of zero groups with :: — the longest run of consecutive all-zero groups collapses into a double colon.
Applied together, the example becomes 2001:db8:85a3::8a2e:370:7334 — the same address, 15 characters shorter.
The rules that trip people up
- :: may appear only once. Two :: in one address would be ambiguous — you could not tell how many zero groups each one replaces. If two runs tie for longest, RFC 5952 says compress the first.
- A single zero group should not be compressed. Replacing one 0 group with :: saves nothing and the standard recommends against it; the group is written as 0 instead. (This tool follows the standard; some systems differ.)
- Hex is case-insensitive, but lowercase is the recommended canonical form.
- The last 32 bits may be written as IPv4 — ::ffff:192.168.1.1 is legal mixed notation, common for mapped addresses.

Expand mode: the reverse direction
Sometimes you need the opposite: the full, unambiguous form for matching patterns in logs, writing firewall rules, or comparing two addresses that look different. The tool's expanded view restores every group to four digits with all zeros written out — the form in which two spellings of the same address become visibly identical. A surprising number of "different" addresses in mixed logs turn out to be the same host wearing compressed and expanded spellings.
Validation built in
The tool parses the address strictly before compressing: wrong group counts, non-hex characters, double :: and misplaced colons are rejected with a plain-English error. That makes it a handy checker when a config file, DNS record or access-control list rejects an address and you need to know whether the address or the system is at fault.
Where compressed form matters
- DNS records — AAAA records are usually published compressed; consistency avoids confusion.
- Documentation and tickets — shorter addresses get copied correctly more often.
- Log analysis — normalise everything to one spelling (compressed or expanded) before searching, or the same host hides under several strings.
- Interviews and exams — the :: rules are a favourite question; the group-by-group breakdown here shows the working, not just the answer.
Related converters
Working with a mapped address? The IPv6 to IPv4 Converter pulls the IPv4 out of ::ffff: forms, and the IPv4 to IPv6 Converter builds them. Once an address is in the form you need, the IP Lookup shows who and where it is.
Hand-checking a compression, worked end to end
Take fe80:0000:0000:0000:0202:b3ff:fe1e:8329 (a typical link-local address from a router label). Step one, strip leading zeros group by group: fe80, 0, 0, 0, 202, b3ff, fe1e, 8329. Step two, find the longest zero run: groups two to four — three zeros in a row, the only run, so it earns the ::. Result: fe80::202:b3ff:fe1e:8329. Count the visible groups to verify: fe80 (1) + :: + four groups = the :: is hiding exactly three groups, 1+3+4 = 8. ✓
Now the trap case: 2001:0db8:0000:0001:0000:0001:0000:0001 has three separate single zero groups and no runs at all. Nothing compresses except leading zeros: 2001:db8:0:1:0:1:0:1. Beginners often write 2001:db8::1:0:1:0:1 — wrong, because that :: would claim a run that does not exist and produce a different address. When in doubt, paste it above: the tool applies the run rules exactly and validates the result.