IPv6 Expander

Expand a compressed IPv6 address to its full 8-group form and report its canonical form.

  • Runs locally in your browser
  • No upload required

Try it

Expanded
2001:0db8:0000:0000:0000:0000:0000:0001
Canonical
2001:db8::1
Groups
8

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

2001:0db8:0000:0000:0000:0000:0000:0001 · canonical 2001:db8::1

How it works

  • Split the address on the `::` shorthand and padded the missing groups with zeroes.
  • Padded each group to four hexadecimal digits for the expanded form.
  • Compressed the longest run of zero groups and removed leading zeroes for the RFC 5952 canonical form.
  • The `::` shorthand represents one or more zero groups; a valid IPv6 address has exactly eight groups when expanded.
  • RFC 5952 requires a single `::` for the longest run of at least two zero groups and lower-case hexadecimal without leading zeroes.

Methodology

  1. Expand any IPv4 tail to two hexadecimal groups.
  2. Resolve `::` by padding missing groups with zeroes.
  3. Pad each group to four digits for the expanded form, then apply the RFC 5952 compression rules for the canonical form.

Usage

  1. Enter an IPv6 address in any accepted form.
  2. Read the fully expanded 8-group form and the canonical form.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Compressed address

jsonSelect to copy
{
  "address": "2001:db8::1"
}

Already explicit

jsonSelect to copy
{
  "address": "2001:0db8:0000:0000:0000:0000:0000:0001"
}

Loopback

jsonSelect to copy
{
  "address": "::1"
}

Limitations

Why IPv6 has two forms

An IPv6 address is 128 bits written as eight 16-bit hexadecimal groups. Because writing all eight is verbose, RFC 4291 allows a single `::` to stand for a run of zero groups and leading zeroes in a group to be dropped.

RFC 5952 then defines one canonical text form so that equal addresses always compare equal as strings. This tool shows both the fully expanded form and that canonical form.

Frequently asked questions

Why does 2001:db8::1 become 2001:0db8:0000:...?
The `::` stands for the zero groups between `2001:db8` and the final `1`; the expanded form writes every one of the eight groups explicitly.
What is the canonical form?
The RFC 5952 recommended textual form: lower-case, no leading zeroes and a single `::` for the longest run of at least two zero groups.

Sources

  1. RFC 4291: IP Version 6 Addressing Architecture — IETF
  2. RFC 5952: A Recommendation for IPv6 Address Text Representation — IETF