Skip to content
ENExplore Calculators

IPv6 Expansion Calculator

Expand a compressed IPv6 address into all eight 16-bit groups with leading zeros restored.

About IPv6 Expansion Calculator

Expansion counts the groups either side of '::', inserts the missing zero groups, and pads each group to four digits — the form most parsers, regexes and hardware tables expect. Fixed-width addresses sort correctly, match reliably in regular expressions, and line up when you are eyeballing prefix boundaries in a capture.

Formula

IPv6 Expansion

'::' is replaced by as many '0000' groups as are needed to reach eight groups, then every group is padded to four hex digits.

::
Compressed run of zero groups being restored

Worked example

With the default values below, IPv6 Expansion Calculator returns Expanded Address of 2001:0db8:0000:0000:0000:ff00:0042:8329. Change any input above and every figure here is recalculated in your browser.

Inputs used

IPv6 address
2001:db8::ff00:42:8329

Results

Expanded Address
2001:0db8:0000:0000:0000:ff00:0042:8329
Compressed Address
2001:db8::ff00:42:8329
Hex Digits
32
16-bit Groups
8

Step by step

  1. 1Values used
  2. 2IPv6 Expansion
  3. 3Expanded Address= 2001:0db8:0000:0000:0000:ff00:0042:8329
  4. 4Compressed Address= 2001:db8::ff00:42:8329
  5. 5Hex Digits= 32
  6. 616-bit Groups= 8

Assumptions and limits

  • The result is derived only from the single input listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is IPv6 Expansion calculated?

'::' is replaced by as many '0000' groups as are needed to reach eight groups, then every group is padded to four hex digits. Expansion counts the groups either side of '::', inserts the missing zero groups, and pads each group to four digits — the form most parsers, regexes and hardware tables expect.

Why does IPv6 Expansion matter?

Fixed-width addresses sort correctly, match reliably in regular expressions, and line up when you are eyeballing prefix boundaries in a capture.

What values do I need to enter?

This calculator takes 1 input: IPv6 address. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

IPv6 Expansion Calculator – Calculate Expanded Address