FormatterHQ

IPv6 to Binary Converter

Paste an IPv6 address to see all 128 bits, grouped per 16-bit block, plus the fully expanded, canonical compressed and decimal forms.

Loading tool…
Ready.

How to use the IPv6 to Binary Converter

  1. Type or paste an IPv6 address into the address field; compressed forms with ::, brackets and zone IDs such as %eth0 are accepted.
  2. Five rows update as you type: grouped binary, raw bits, expanded, compressed and decimal.
  3. Use the expanded form for sorting or matching, and the compressed form for documentation.
  4. Copy the row you need with its copy button.

IPv6 to binary, expanded and compressed

An IPv6 address is 128 bits long, written as eight groups of four hex digits. Converting IPv6 to binary shows every one of those bits, which makes prefixes such as /48 or /64 easy to see. The converter also prints the fully expanded form, the shortest canonical form and the address as one large decimal number.

Example output

2001:db8::1

Binary:      0010000000000001:0000110110111000:0000000000000000: … :0000000000000001
Expanded:    2001:0db8:0000:0000:0000:0000:0000:0001
Compressed:  2001:db8::1
Decimal:     42540766411282592856903984951653826561

The grouped binary line is shortened here. The real output lists all eight 16-bit groups, followed by a line with the 128 bits as one unbroken string.

How IPv6 notation shrinks

  • Leading zeros in a group may be dropped: 0db8 becomes db8.
  • One run of zero groups may be replaced by ::. It can appear only once, otherwise the reader cannot tell how many zeros each gap holds, so input like 1::2::3 is rejected.
  • Canonical form (RFC 5952) uses lowercase letters, compresses the longest run of zero groups, prefers the first run on a tie and never uses :: for a single zero group. That is why 2001:db8:0:0:1:0:0:1 becomes 2001:db8::1:0:0:1.

Reading the bits

Each hex digit maps to exactly four bits, so group 2001 is 0010 0000 0000 0001. A prefix length counts bits from the left: in a typical /64 LAN, the first four groups are the network prefix and the last four are the interface identifier. The link-local range fe80::/10 is recognizable because the first ten bits are 1111111010.

IPv4-mapped addresses

Dual-stack software represents IPv4 peers as IPv4-mapped IPv6 addresses: 80 zero bits, 16 one bits, then the 32-bit IPv4 address. You can type them with a dotted tail:

::ffff:192.168.1.1
Expanded:    0000:0000:0000:0000:0000:ffff:c0a8:0101
Compressed:  ::ffff:c0a8:101

The converter prints the tail in hex (c0a8:101), which is the same address as the dotted spelling. The last 32 bits match what IP to Binary shows for 192.168.1.1.

Input details

Square brackets (as in URLs) and a zone ID such as %eth0 are stripped before conversion; a trailing prefix like /64 sets the Prefix length slider of the subnet panel instead. A group with more than four hex digits, an invalid character or the wrong number of groups produces an error naming the address. To work out the range covered by a prefix, use the CIDR calculator, which accepts IPv6 blocks; for plain hex numbers, Hex to Binary does the digit-by-digit mapping. Everything runs in your browser.

Frequently asked questions

How many bits are in an IPv6 address?
128 bits, split into eight 16-bit groups. Each group is written as up to four hexadecimal digits.
How do I expand a compressed IPv6 address?
Pad every group to four digits and replace :: with as many 0000 groups as needed to reach eight groups. For example, 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001.
Can :: appear twice in an IPv6 address?
No. With two gaps there is no way to know how many zero groups belong in each, so the address would be ambiguous. Only one :: is allowed.
What does ::ffff: in front of an IPv4 address mean?
It marks an IPv4-mapped IPv6 address, which dual-stack sockets use to represent an IPv4 client. ::ffff:192.168.1.1 is the IPv6 representation of 192.168.1.1.
Why is my IPv6 address invalid?
Common causes are more than one ::, a group longer than four hex digits, a letter beyond f, or too many groups. The error message quotes the address so you can fix it.

Last updated October 3, 2026

Guides

Related tools