IPv6 notation guide

How to expand an IPv6 address

IPv6 expansion restores the complete 128-bit form of a compressed address: eight hexadecimal groups, each containing exactly four digits.

IPv6 structure

Eight groups make 128 bits

An IPv6 address contains 128 bits. In its complete text form, it is written as eight colon-separated groups. Each group contains four hexadecimal digits, representing 16 bits.

For example, 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001.

Expansion rule

Replace :: with zero groups

The double colon represents one or more omitted 0000 groups. Count the visible groups, then insert enough zero groups to reach a total of eight.

fe80::1
becomes
fe80:0000:0000:0000:0000:0000:0000:0001

Leading zeroes

Pad every visible group to four digits

Expansion also restores omitted leading zeroes. A group written as db8 becomes 0db8; a group written as 1 becomes 0001.

Subnet analysis

Why the expanded form helps with binary math

An expanded address makes every 16-bit boundary visible. That is useful when checking IPv6 prefixes, comparing subnet ranges, or converting hexadecimal groups to binary. A /64 prefix ends after the first four full hexadecimal groups.

2001:0db8:0000:0000 | 0000:0000:0000:0001
first 64 bits (network) | final 64 bits (interface identifier)

Worked examples

IPv6 address expansion examples

::1

0000:0000:0000:0000:0000:0000:0000:0001

2001:db8::1

2001:0db8:0000:0000:0000:0000:0000:0001

2606:4700:4700::1111

2606:4700:4700:0000:0000:0000:0000:1111

Reference addresses

Expand common special IPv6 addresses