Skip to content
Calcrivo

IPv6 Expansion Calculator

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

Inputs

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. Values used

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

  2. 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.

  3. Expanded Address

    = 2001:0db8:0000:0000:0000:ff00:0042:8329

  4. Compressed Address

    = 2001:db8::ff00:42:8329

  5. Hex Digits

    = 32

  6. 16-bit Groups

    = 8

How it works

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

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.

You might also need