IPv6 Compression & Expansion Tool
Convert between expanded and compressed notation — with validation and a full component breakdown
Paste any IPv6 address — compressed (2001:db8::1), fully expanded
(2001:0db8:0000:0000:0000:0000:0000:0001) or with an IPv4 tail
(::ffff:192.0.2.1) — and get both canonical forms back, a syntax check,
and a breakdown of all eight 16-bit groups, the 128-bit binary and the address type.
Paste one address at a time, or drop a whole list into the batch panel below.
Batch convert
Paste one address per line to validate and convert a whole list at once — handy for config files, firewall rules or a block of addresses from a ticket.
How IPv6 compression works
A full IPv6 address is 128 bits, written as eight 16-bit groups of four hex digits separated by colons — 39 characters long. That is unwieldy, so two shortening rules (standardised in RFC 5952) let you write the same address much shorter. Both forms are always interchangeable; this tool shows you both.
Rule 1 — drop leading zeros
Within a group, leading zeros are omitted. 2001:0db8:0000:0001 becomes
2001:db8:0:1. A group that is all zeros is written as a single 0.
Rule 2 — collapse the longest zero run with ::
The longest run of consecutive all-zero groups is replaced by ::. If two runs
tie for longest, the leftmost one is compressed. A run of only a single zero group
is not compressed (writing :: for one group saves nothing and adds
ambiguity). :: may appear at most once per address.
| Expanded | Compressed | Why |
|---|---|---|
| 2001:0db8:0000:0000:0000:0000:0000:0001 | 2001:db8::1 | Longest zero run (five groups) collapsed; leading zeros dropped. |
| 0000:0000:0000:0000:0000:0000:0000:0001 | ::1 | Loopback — seven leading zero groups collapse to ::. |
| 2001:0db8:0001:0000:0000:0000:0000:0001 | 2001:db8:1::1 | The right-hand run (four groups) is longer than the single zero in the middle, so it wins. |
| 2001:0db8:0001:0000:0000:0000:0000:0001 | 2001:db8:1::1 | Same address — compression is deterministic, so the output is always the same. |
Common pitfalls
- Two
::is invalid — there would be no way to know how many zero groups each stands for. - Compressing a single zero group is discouraged:
2001:db8::1:2:3:4:5for one zero group is legal but non-canonical; RFC 5952 keeps it as2001:db8:0:1:2:3:4:5. - Case is insignificant —
2001:DB8::1and2001:db8::1are the same address. RFC 5952 recommends lowercase. - IPv4 tails like
::ffff:192.0.2.1are a valid shorthand for the last 32 bits; the tool shows the equivalent pure-hex form too. - Zone IDs (
fe80::1%eth0) identify the interface for link-local addresses; the%part is not part of the address itself.
Special address ranges
| Type | Range | Meaning |
|---|---|---|
| Unspecified | :: | No address assigned (0:0:0:0:0:0:0:0). |
| Loopback | ::1 | The host itself — the IPv6 equivalent of 127.0.0.1. |
| Link-local | fe80::/10 | Valid only on a single link; auto-configured on every interface. |
| Unique local (ULA) | fc00::/7 | Private, site-local addressing (like 10.0.0.0/8) — not routed on the internet. |
| Global unicast | 2000::/3 | Publicly routable addresses. |
| Multicast | ff00::/8 | One-to-many delivery; replaces IPv4 broadcast. |
| IPv4-mapped | ::ffff:0:0/96 | An embedded IPv4 address, e.g. ::ffff:192.0.2.1. |
Need the network side of things — CIDR, subnet masks, usable host counts and /64 planning — see the IP Address & Subnet Calculator.