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:
0db8becomesdb8. - 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 like1::2::3is 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 why2001:db8:0:0:1:0:0:1becomes2001: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.