Binary to IPv6 Converter
Convert 128-bit binary strings to full and compressed IPv6 addresses instantly. Supports dotted, spaced, and continuous binary input formats.
About
IPv6 addresses are 128-bit identifiers written as eight colon-separated groups of four hexadecimal digits. Miscounting a single bit during manual conversion flips an entire hex nibble, routing traffic to an unintended host or black-holing it entirely. This tool parses raw binary input - continuous, space-delimited, dot-separated, or colon-grouped - strips formatting characters, validates the length against the 128-bit ceiling, and maps each 16-bit block to its hexadecimal equivalent via parseInt(block, 2). It then applies RFC 5952 compression rules: leading zeros within each group are removed, and the longest run of consecutive all-zero groups collapses into a single :: token. Inputs shorter than 128 bits are right-padded with zeros, matching how partial prefixes behave in real routing tables.
The converter assumes well-formed binary digits only (0 and 1). It does not infer intent from ambiguous separators. If your source material already contains hex characters, use a hex-to-IPv6 formatter instead. Pro tip: when debugging firewall rules or ACLs, always verify the full expanded form before applying compression - two different compressed notations can hide the same address, but two different expanded forms never can.
Formulas
An IPv6 address is a 128-bit unsigned integer. The conversion from binary to colon-hex notation proceeds in three stages: grouping, base conversion, and optional compression.
Each 16-bit group Gi converts to a 4-digit hexadecimal value:
where bj ∈ {0, 1} is the bit at position j (bit 15 is the MSB within each group). The decimal result is then expressed in base 16.
RFC 5952 compression rules: (1) remove leading zeros from each group (00a1 → a1); (2) replace the longest contiguous sequence of all-zero groups with ::; (3) if two sequences of equal length exist, replace only the leftmost.
Where b = raw binary string, Gi = the i-th 16-bit group (i ∈ [1, 8]), hex = base-16 conversion function, and j = bit index within each group.
Reference Data
| IPv6 Address Type | Prefix (Binary, first 16 bits) | Full IPv6 (Expanded) | Compressed IPv6 | RFC |
|---|---|---|---|---|
| Unspecified | 0000...0000 (128 zeros) | 0000:0000:0000:0000:0000:0000:0000:0000 | :: | RFC 4291 |
| Loopback | 0000...0001 (127 zeros + 1) | 0000:0000:0000:0000:0000:0000:0000:0001 | ::1 | RFC 4291 |
| Link-Local Unicast | 1111111010 | fe80:0000:0000:0000:... | fe80::... | RFC 4291 |
| Multicast | 11111111 | ff00:0000:... | ff00::... | RFC 4291 |
| Global Unicast | 001 | 2000:0000:... to 3fff:ffff:... | Varies | RFC 3587 |
| Unique Local (ULA) | 1111110 | fc00:0000:... to fdff:ffff:... | fc00::/7 | RFC 4193 |
| 6to4 | 0010000000000010 | 2002:xxxx:... | 2002::... | RFC 3056 |
| Teredo | 0010000000000001 0000000000000000 | 2001:0000:... | 2001:0:... | RFC 4380 |
| Documentation | 0010000000000001 0000110110111000 | 2001:0db8:... | 2001:db8:: | RFC 3849 |
| All Nodes (Link-Local) | Fixed address | ff02:0000:0000:0000:0000:0000:0000:0001 | ff02::1 | RFC 4291 |
| All Routers (Link-Local) | Fixed address | ff02:0000:0000:0000:0000:0000:0000:0002 | ff02::2 | RFC 4291 |
| Solicited-Node Multicast | 1111111100000010 ... 1 | ff02:0000:0000:0000:0000:0001:ffxx:xxxx | ff02::1:ffxx:xxxx | RFC 4291 |
| IPv4-Mapped IPv6 | 0000...0000 1111111111111111 | 0000:0000:0000:0000:0000:ffff:xxxx:xxxx | ::ffff:x.x.x.x | RFC 4291 |
| Discard-Only | 0000000100000000 | 0100:0000:... | 100::/64 | RFC 6666 |