🪗 IPv6 Expand / Compress
Paste one IPv6 address or a whole list: get the fully expanded form for databases and sorting, or the canonical RFC 5952 compressed form for configs and docs.
| Input | Canonical |
|---|---|
| 2001:0db8:0000:0000:0000:ff00:0042:8329 | 2001:db8::ff00:42:8329 |
| fe80:0:0:0:0:0:0:1 | fe80::1 |
Parsing and normalization run locally — paste internal addresses without worry.
How the ipv6 expand / compress works
The same IPv6 address can be written many ways — 2001:db8:0:0:0:0:0:1, 2001:0db8::0001 and 2001:db8::1 are identical — which breaks naive string comparison in scripts, ACL reviews and log greps. This tool parses each line and outputs either the fully expanded form (eight 4-digit groups, fixed width, sorts correctly as text) or the canonical compressed form defined by RFC 5952 (lowercase, longest zero-run become ::, leading zeros dropped). Batch mode handles a pasted column of addresses in one go, which is the usual real-world job: normalizing a list pulled from logs or a spreadsheet before comparing it against a config.
RFC 5952 exists precisely because compression used to be ambiguous — 2001:db8:0:0:1:0:0:1 can legally be written with :: in two places. The canonical rule (compress the longest run; if tied, the leftmost) gives every address exactly one short form, so normalize both sides before diffing address lists.
Frequently asked questions
Why do the same IPv6 addresses look different in different tools?
IPv6 text form allows dropping leading zeros and compressing zero runs with ::, so one address has many valid spellings. Tools emit whichever they like — normalizing to one form is the fix.
When should I use the expanded form?
Anywhere fixed-width text helps: database columns, sorting address lists as text, aligning columns in documentation, or regex matching in logs.
What does RFC 5952 actually require?
Lowercase hex; no leading zeros within groups; :: must replace the longest run of two or more all-zero groups (leftmost if tied); and a single zero group is never compressed with ::.
Can I paste a whole list?
Yes — one address per line, and the tool converts every line, flagging any that fail to parse.