IPv6 to Binary Converter

See every one of the 128 bits behind an IPv6 address, with the double colon shorthand expanded for you.

IPv6
Binary
Runs locally in your browser

About the IPv6 to Binary Converter

Subnetting arguments and exam questions both come down to the same thing: which bits does the prefix actually cover. Because IPv6 is written in hexadecimal and compressed with ::, that is hard to eyeball. This converter expands the address first, then prints the bits so you can count them.

The parser handles the shorthand properly. A single :: is expanded to as many zero groups as the address needs, a second one is rejected as ambiguous, a zone identifier such as %eth0 is dropped, square brackets from a URL are removed, and a prefix length after a slash is ignored so a route entry pastes in cleanly. IPv4 mapped addresses like ::ffff:192.168.1.1 are converted through their dotted part into the last two groups.

Four layouts suit different jobs. Groups keeps the colon structure with 16 bits between each colon, which lines up with the hex you started from. Bytes splits into 8 bit chunks for byte level work. The continuous layout gives one 128 character string for scripts and diffs. The table layout prints each hex group beside its bits, which is the clearest way to teach or check a subnet boundary.

To tidy the address itself rather than expand it, IPv6 Compressor and IPv6 Expander are the tools, and IP to Binary does the same job for 32 bit IPv4.

How to use

  1. Paste one IPv6 address per line, compressed or full.
  2. Choose the layout that matches what you are checking.
  3. Compare the bits against your prefix length.
  4. Copy the expanded bits or download them as a text file.

Common questions

How many bits should I see?
Always 128, written as eight groups of 16 bits, no matter how short the compressed address looked.
Does it accept an address with a prefix such as /64?
Yes. The prefix length is stripped and the address itself is expanded, so route table entries can be pasted directly.
What about a link local address with a zone?
A zone identifier like %eth0 is removed before parsing, since it identifies an interface rather than part of the address.
Why is a second :: rejected?
Two of them make the number of hidden zero groups ambiguous, so the address cannot be expanded to one correct value.