IPv6 to Binary
Convert IPv6 addresses to 128-bit binary and back.
IPv6 to Binary Converter
Expand any IPv6 address into its full 128-bit binary form, or turn a binary string back into a properly compressed IPv6 address. Paste one address per line – 2001:db8::1, fe80::1%eth0, ::ffff:192.168.0.1, or 2001:db8::/32 – and the binary appears instantly, grouped the way you prefer.
How IPv6 addresses are built
An IPv6 address is 128 bits long. It is written as eight groups of 16 bits, each group as up to four hexadecimal digits separated by colons: 2001:0db8:0000:0000:0000:ff00:0042:8329. Two shortening rules make addresses easier to type:
- Leading zeros in a group may be dropped:
0db8→db8,0042→42. - One run of consecutive all-zero groups may be replaced by
::– but only once per address.
So the example above is usually written 2001:db8::ff00:42:8329. To convert to binary, the converter first expands the ::, then writes each hex digit as four bits. 2001 becomes 0010000000000001, db8 becomes 0000110110111000, and so on.
What the tool handles
- Zero compression anywhere in the address, including
::and::1. - Embedded IPv4 in the last 32 bits, e.g.
::ffff:192.168.0.1(IPv4-mapped) and64:ff9b::8.8.8.8(NAT64). - Prefix lengths such as
/64are kept and appended to the output. - Zone IDs like
%eth0and square brackets from URLs are removed.
When converting binary back, the output follows RFC 5952: lowercase hex, no leading zeros, and the longest run of zero groups compressed. Turn off Compress zeros to get the full eight-group form.
Why convert IPv6 to binary?
Binary makes the network prefix visible. With /64, the first 64 bits are the network and the last 64 bits the interface identifier; with /48 or /56 you can see exactly which bits are available for subnetting. It is also useful for studying for networking exams, debugging ACLs and firewall rules, and understanding EUI-64 interface IDs.
To calculate IPv6 network ranges, use the CIDR Calculator. For IPv4 addresses, use Binary to IP.
Frequently Asked Questions
How many bits is an IPv6 address?
128 bits, written as eight 16-bit groups of hexadecimal digits. IPv4 addresses, in comparison, have 32 bits.
What does :: mean in an IPv6 address?
It replaces one run of consecutive all-zero groups. ::1 is therefore 0:0:0:0:0:0:0:1, the loopback address. :: may appear only once, otherwise the address would be ambiguous.
Can I convert an IPv4-mapped address?
Yes. Addresses like ::ffff:192.168.0.1 are supported; the dotted IPv4 part is converted into the last 32 bits.
Does it keep the prefix length?
Yes. If you enter 2001:db8::/32, the binary output ends with /32 so you can see which bits belong to the prefix.