Calculator: IPv6 expansion and compression

Enter the labelled inputs to calculate: Expanded address; Compressed address.

Expanded address
2001:0db8:0000:0000:0000:0000:0000:0001
Compressed address
2001:db8::1

How the calculation works

IPv6=128 bit=8×16 bit; RFC 5952

IPv4 uses strict dotted decimal. IPv6 accepts embedded IPv4 tails and compresses the longest leftmost zero run. Zone identifiers are excluded. Prefix tools describe address ranges, not routability or host allocation policy.

Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

Frequently asked questions

How is the result calculated?

IPv6=128 bit=8×16 bit; RFC 5952

What assumptions apply?

IPv4 uses strict dotted decimal. IPv6 accepts embedded IPv4 tails and compresses the longest leftmost zero run. Zone identifiers are excluded. Prefix tools describe address ranges, not routability or host allocation policy.

How precise are the displayed results?

Numerical results show up to ten significant digits. Rounding does not improve the accuracy of the input measurements or the model. Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.

How we verified this calculator

The calculator is checked against 3 reference cases computed independently from the sources below. Last passed: .

# Inputs Expected result
1
Address = 2001:db8::1
Expanded address: 2001:0db8:0000:0000:0000:0000:0000:0001
Compressed address: 2001:db8::1
2
Address = 2001:0db8:0000:0000:0001:0000:0000:0001
Expanded address: 2001:0db8:0000:0000:0001:0000:0000:0001
Compressed address: 2001:db8::1:0:0:1
3
Address = fe80::200:5aee:feaa:20a2
Expanded address: fe80:0000:0000:0000:0200:5aee:feaa:20a2
Compressed address: fe80::200:5aee:feaa:20a2

Sources

How we test our calculators →

Also try:

Back to category →