How to use this calculator
- Enter or choose iPv6 address.
- The canonical (RFC 5952) form updates as you type. Use Copy result or Share to keep it.
Method
Parse to eight 16-bit groups (RFC 4291 §2.2), then: drop leading zeros; replace the longest run of ≥ 2 all-zero groups with “::” (first run on a tie, never a single group); write a–f in lowercase (RFC 5952 §4). IPv4-mapped addresses are written ::ffff:a.b.c.d (RFC 5952 §5).
- Group
- 16 bits written as 1–4 hex digits
Worked example
- Drop leading zeros: 2001:db8:0:0:1:0:0:1.
- There are two runs of two zero groups; they tie, so the first is replaced.
- Result: 2001:db8::1:0:0:1.
2001:0db8:0000:0000:0001:0000:0000:0001 is written 2001:db8::1:0:0:1 in canonical form.
What the result means
Use the canonical form in logs, configs and documentation so the same address is always written the same way and text searches find it.
Assumptions and limits
- Zone indexes (such as %eth0) are not part of the address and must be removed.
- Address type is based on the well-known prefixes only; it does not check whether a prefix is actually allocated or routed.
Questions
Why not compress a single zero group?
RFC 5952 forbids using “::” for a single 16-bit zero field, so 2001:db8:0:1:1:1:1:1 stays as it is.
Are uppercase letters wrong?
They are valid input, but RFC 5952 recommends lowercase for output, so tools and people produce identical text.