Connectivity

IP to Binary Converter

See every bit of an IPv4 or IPv6 address. Convert both ways, keep every leading zero, and explore where network bits end.

IPv4 or IPv6, with an optional /prefix. Up to 100 nonblank lines, 400 characters per line, and 50,000 characters total. Blank lines are skipped.

Ctrl / ⌘ + Enter to convert
Try an example

Ready. Conversion happens in your browser; nothing is uploaded or saved.

Accepted input and exact-width rules

Use four decimal IPv4 octets from 0 to 255, without leading zeros. IPv6 accepts eight hexadecimal hextets, one :: compression, and an optional dotted IPv4 tail. Zone IDs, brackets, URLs, ports, and hostnames are outside this converter’s scope.

Reverse input must contain exactly 32 bits for IPv4 or 128 for IPv6. Use a continuous bit string; four dotted 8-bit groups; eight colon-separated 16-bit groups; or equal 4-, 8-, or 16-bit groups separated by spaces or tabs. Do not mix separator styles. Short groups, 0b prefixes, and all other characters are rejected. No missing bits are invented.

An optional /prefix uses decimal digits: /0 through /32 for IPv4 or /0 through /128 for IPv6. It highlights the original address’s network and host bits; the address itself is not changed. The derived network is shown separately. All bit strings are in network order, most significant bit first.

How the binary working is calculated

An IPv4 octet has eight place values: 128, 64, 32, 16, 8, 4, 2, and 1. Add the values under its 1 bits. For example, 11000000 = 128 + 64 = 192. Four octets make 32 bits.

An IPv6 hextet has 16 bits, with place values from 32768 down to 1. Each hexadecimal digit accounts for four bits; 0db8 is 0000 1101 1011 1000. Eight hextets make 128 bits. Expanded and compressed IPv6 output here always use hexadecimal, including addresses entered with a dotted IPv4 tail.

IPv6 input follows RFC 4291’s address forms. Compressed hexadecimal output follows the longest-zero-run, first-tie, lowercase rules in RFC 5952 section 4. This tool converts representations; it does not check whether an address is assigned or reachable.