IP Address to Binary

Convert an IPv4 or IPv6 address to binary, hex and decimal with a per-octet breakdown.

Try 8.8.8.8, 255.255.255.0 or 2001:db8::1.

Binary (grouped)
โ€”
Binary (32 bits, no separators)
โ€”
Hexadecimal
โ€”
Decimal (integer)
โ€”
Octal (grouped)
โ€”
Normalized address
โ€”
Version
โ€”
Address type
โ€”
Each part of the address in decimal, binary and hex
Octet Decimal Binary Hex

Binary back to an IP address

Address โ€”

Bulk convert a list

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

An IPv4 address is really a single 32-bit number written as four 8-bit octets. Each octet is converted to base 2 using the place values 128, 64, 32, 16, 8, 4, 2, 1 and padded to eight digits, so 192 becomes 11000000 (128 + 64) and 10 becomes 00001010 (8 + 2). Put the four together and 192.168.1.10 is 11000000.10101000.00000001.00001010, which as one unsigned integer is 3,232,235,786 and in hex 0xC0A8010A. IPv6 works the same way with eight 16-bit hextets instead, giving 128 bits in total; :: is expanded to the zero groups it stands for before converting.

Seeing the bits is what makes subnet masks click: a /24 mask is 24 ones followed by 8 zeros, and the network part of an address is simply the bits the mask keeps. Use the second box to go the other way โ€” paste 32 binary digits for IPv4 or 128 for IPv6 and get the address back โ€” or the bulk box to convert a whole list at once and download it as CSV.

Everything is computed by JavaScript in your browser. No address you type is uploaded, logged or looked up anywhere โ€” there is no sign-up and no ads.

Frequently asked questions

How do you convert an IP address to binary?

Take each of the four octets of an IPv4 address and write it in base 2 using the place values 128, 64, 32, 16, 8, 4, 2 and 1, padding the result to eight digits. For example 192 is 128 + 64, so it becomes 11000000, and 10 is 8 + 2, so it becomes 00001010. Joining the four octets with dots gives the full 32-bit address. This tool does that as you type and also shows each octet in decimal and hex.

What is 192.168.1.1 in binary?

192.168.1.1 is 11000000.10101000.00000001.00000001 in binary, 0xC0A80101 in hexadecimal and 3,232,235,777 as a single unsigned 32-bit integer. Paste any other address into the box to see the same breakdown for it.

Does this work with IPv6 addresses?

Yes. An IPv6 address is 128 bits written as eight 16-bit hextets, so each group becomes 16 binary digits. Compressed forms such as 2001:db8::1 and IPv4-mapped addresses like ::ffff:192.168.1.1 are expanded first, and the tool also shows the full 128-bit integer. You can paste 128 binary digits into the reverse box to get the address back.

Report a bug