IPv6 to Binary Converter

Convert IPv6 notation to full 128-bit binary output (great for labs and education).

Result

About this tool

IPv6 to Binary expands a compressed or full IPv6 address into its complete 128-bit binary representation. Where IPv4 has 32 bits across 4 octets, IPv6 has 128 bits across 8 groups of 16 bits (hextets). Seeing the full binary form makes prefix boundaries, subnet divisions, and address structure immediately visible - something that is impossible to reason about from the compressed colon-hex notation alone.

Real example

Input: 2001:db8::1

Step 1 - expand the :: shorthand to its full 8-hextet form:
2001:0db8:0000:0000:0000:0000:0000:0001

Step 2 - convert each hextet to 16-bit binary:
2001 -> 0010000000000001
0db8 -> 0000110110111000
0000 -> 0000000000000000 (×5 repeated)
0001 -> 0000000000000001

The 2001:db8::/32 documentation prefix (defined in RFC 3849) is commonly used in examples. The /32 prefix covers the first 32 bits: 00100000000000010000110110111000.

Common use cases

  • IPv6 prefix boundary visualization: When working with a /48 allocation, the first 48 bits are the network prefix. Converting to binary makes the boundary between network and interface portions clearly visible at bit position 48.
  • Subnetting coursework and certifications: IPv6+ certifications (CCNP, JNCIP) require understanding address structure at the bit level. This tool helps validate manual exercises.
  • Teaching IPv6 compression rules: The :: shorthand compresses consecutive zero groups. Showing the expanded binary form demonstrates exactly what is being omitted.
  • Validating address expansion scripts: If you have written code to expand compressed IPv6 addresses, run known test cases through this tool to confirm the binary output matches your implementation.

How it works

The input is parsed and the :: double-colon is expanded by inserting the correct number of zero groups to reach 8 hextets total. Each 4-character hextet is parsed as a 16-bit integer with parseInt(hextet, 16) and then converted to a 16-bit binary string with leading-zero padding. The 8 groups are concatenated into a 128-bit string, and also displayed grouped with colons for readability.

Common mistakes

  • Confusing prefix length with bit position: A /64 prefix means the first 64 bits are the network prefix. That is the first four 16-bit hextets. The remaining 64 bits are the interface identifier (EUI-64 or random). This does not mean 64 ones in the binary - it means the first 64 bits identify the network.
  • Invalid :: placement: The double-colon can only appear once in an address. 2001::db8::1 is invalid. This tool will return an error for addresses with multiple :: instances.
  • Expecting IPv4 behavior: IPv6 subnetting does not use the concept of broadcast addresses. The all-zeros and all-ones addresses in a subnet have different reserved uses than in IPv4.

FAQ

Does the tool accept compressed IPv6 addresses
Yes. Both compressed forms (with ::) and fully expanded 8-hextet addresses are supported.

What is the binary for the loopback address ::1
::1 expands to 0000:0000:0000:0000:0000:0000:0000:0001, which is 127 zero bits followed by a single 1 bit.

Can I use this for production subnet planning
This tool shows binary representations - it does not calculate subnet ranges. For production planning, use a dedicated IPv6 subnet calculator.

What is a hextet
A hextet (sometimes called a group or field) is one of the eight 16-bit segments in an IPv6 address, written as four hex digits. IPv6 has 8 hextets; IPv4 has 4 octets. The terms reflect the different base representations.

IPv6 address structure in binary

An IPv6 address is 128 bits — four times the length of IPv4. In binary, it is written as eight groups of 16 bits, each group corresponding to one hextet in the colon-delimited notation. The full expansion of 2001:db8::1 is 2001:0db8:0000:0000:0000:0000:0000:0001, which in binary is:

0010000000000001 0000110110111000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000001

In binary, the structure of an IPv6 address reveals things the hex notation hides. The leading bits determine the address type — the first few bits are called the Format Prefix:

  • 0010... (first 3 bits = 001) — Global Unicast Address (GUA). These are publicly routable IPv6 addresses. The 2001::/16 range (which includes 2001:db8::/32 for documentation) falls here.
  • 11111110 10... — Link-Local addresses (fe80::/10). These are automatically configured on every IPv6 interface and are not routable beyond the local link.
  • 11111111... — Multicast addresses (ff00::/8). The second byte encodes the scope: ff02::/16 is link-local multicast, ff0e::/16 is global multicast.
  • 00...001 (all zeros except last bit) — Loopback address ::1. Equivalent to 127.0.0.1 in IPv4.

The :: compression rule

IPv6 allows consecutive groups of all-zero hextets to be collapsed into :: once per address. This makes many common addresses more readable but requires expansion before binary conversion. The rule: count the missing hextets (total hextets present minus 8), and insert that many 0000 groups at the :: position.

::1 has one hextet (the trailing 1), so :: represents seven zero hextets: 0000:0000:0000:0000:0000:0000:0000:0001. fe80::1 has two hextets, so :: represents six zero hextets: fe80:0000:0000:0000:0000:0000:0000:0001. This tool handles all valid compression forms automatically.

Subnet prefixes in binary

IPv6 subnets work identically to IPv4 CIDR in binary — a prefix length defines how many leading bits are the network portion. A /64 prefix means the first 64 bits identify the network and the last 64 bits are the interface identifier (usually derived from the MAC address via EUI-64, or randomly generated for privacy). In binary, the boundary between network and host bits falls exactly at bit 64 — between the fourth and fifth hextet.

ISPs typically assign /48 prefixes to enterprises (leaving 16 bits for internal subnet numbering and 64 bits for hosts) and /56 or /64 prefixes to residential connections. A /128 prefix is a single host address with no host bits — used for loopback and specific host routes.

For IPv4 binary conversion, use IP to Binary. For subnet range calculation in IPv4, see CIDR IP Converter. For geolocation and ASN lookup of an IPv6 address, try IP Lookup.

Related tools