IP address to binary converter
An IPv4 address is a 32-bit number written as four 8-bit octets, so 192.168.1.10 is 11000000.10101000.00000001.00001010 in binary. Enter an address in dotted decimal, binary, a single integer or hex to see every form with the working.
In binary
11000000.10101000.00000001.00001010
Read as dotted decimal · 3,232,235,786 as one number
- Dotted decimal
- 192.168.1.10
- Dotted binary
- 11000000.10101000.00000001.00001010each octet as 8 bits
- 32-bit binary
- 11000000101010000000000100001010the same 32 bits without dots
- Decimal integer
- 32322357863,232,235,786; MySQL's INET_ATON() returns this number
- Hexadecimal
- 0xC0A8010Atwo hex digits per octet
- Hexadecimal, dotted
- C0.A8.01.0A0xC0.0xA8.0x01.0x0A with prefixes
| Octet | Decimal | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Sum of the 1s |
|---|---|---|---|---|---|---|---|---|---|---|
| 1st | 192 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 128 + 64 = 192 |
| 2nd | 168 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 128 + 32 + 8 = 168 |
| 3rd | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 4th | 10 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 8 + 2 = 10 |
- 192.168.1.10 is in 192.168.0.0/16, private-use (RFC 1918).
How do you convert an IP address to binary?
An IPv4 address is a 32-bit number; RFC 791 defines addresses as a fixed four octets. Dotted decimal writes each 8-bit octet as a number from 0 to 255, so converting to binary means writing each of the four numbers as exactly 8 bits and keeping the dots: 192 is 11000000, 168 is 10101000, 1 is 00000001 and 10 is 00001010.
To convert one octet by hand, take the place values 128, 64, 32, 16, 8, 4, 2 and 1 from the left. Write 1 under each value you can subtract from what is left of the number, and 0 under the rest: 168 is 128 + 32 + 8, so it is 10101000. Always keep all eight digits, including the leading zeros, or the bits of the next octet shift into the wrong places.
The same 32 bits can be read as one number: the first octet × 256³ + the second × 256² + the third × 256 + the fourth, so 192.168.1.10 is 3,232,235,786. That is the integer MySQL's INET_ATON() returns, and the form to store in an unsigned 32-bit column. In hex, each octet is two digits: 192.168.1.10 is 0xC0A8010A.
This converter refuses parts with leading zeros, such as 192.168.010.1. The C library's inet_aton reads a part that starts with 0 as octal, so 010 is 8 there, not 10; Python's ipaddress module has rejected leading zeros since version 3.9.5 to avoid that confusion. Short forms such as 127.1, which inet_aton accepts as 127.0.0.1, are also refused: write all four octets.
place values: 128 (2⁷) 64 (2⁶) 32 (2⁵) 16 (2⁴) 8 (2³) 4 (2²) 2 (2¹) 1 (2⁰) 192 = 128 + 64 → 11000000 168 = 128 + 32 + 8 → 10101000 192.168.1.10 → 11000000.10101000.00000001.00001010 as one number = 192 × 256³ + 168 × 256² + 1 × 256 + 10 = 3,232,235,786
What are the place values of an octet and some well-known addresses in binary?
| Decimal | Binary | Hex | Notes |
|---|---|---|---|
| 128 | 10000000 | 80 | 2⁷: bit 1 of the octet, counting from the left |
| 64 | 01000000 | 40 | 2⁶: bit 2 of the octet, counting from the left |
| 32 | 00100000 | 20 | 2⁵: bit 3 of the octet, counting from the left |
| 16 | 00010000 | 10 | 2⁴: bit 4 of the octet, counting from the left |
| 8 | 00001000 | 08 | 2³: bit 5 of the octet, counting from the left |
| 4 | 00000100 | 04 | 2²: bit 6 of the octet, counting from the left |
| 2 | 00000010 | 02 | 2¹: bit 7 of the octet, counting from the left |
| 1 | 00000001 | 01 | 2⁰: bit 8 of the octet, counting from the left |
| 255 | 11111111 | FF | all eight bits set, the largest octet (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1) |
| 0.0.0.0 | 00000000.00000000.00000000.00000000 | 00.00.00.00 | “This host on this network” (RFC 1122); 0 as one number |
| 127.0.0.1 | 01111111.00000000.00000000.00000001 | 7F.00.00.01 | Loopback, this computer (RFC 1122); 2,130,706,433 as one number |
| 10.0.0.1 | 00001010.00000000.00000000.00000001 | 0A.00.00.01 | Private-use (RFC 1918); 167,772,161 as one number |
| 192.168.1.1 | 11000000.10101000.00000001.00000001 | C0.A8.01.01 | Private-use (RFC 1918); 3,232,235,777 as one number |
| 255.255.255.255 | 11111111.11111111.11111111.11111111 | FF.FF.FF.FF | Limited broadcast (RFC 919, RFC 8190); 4,294,967,295 as one number |
How to convert an IP address to binary
- 1Enter the addressType or paste an IPv4 address in any common form: 192.168.1.10, 11000000.10101000.00000001.00001010, 3232235786 or 0xC0A8010A.
- 2Check the detected formatThe result says how your input was read, such as dotted decimal or dotted binary, and explains anything it refused, such as a leading zero or an octet over 255.
- 3Copy the form you needCopy the dotted binary, the 32 bits in a row, the single decimal number or the hex form from the result.
- 4Follow the workingThe octet table shows which of the place values 128 to 1 are set in each octet and how they add up.
Frequently asked questions
How do I convert an IP address to binary by hand?
What is 192.168.1.1 in binary?
Why does each part of an IPv4 address stop at 255?
Why is an IP address sometimes stored as one big number?
Why are leading zeros not allowed in an IP address?
Sources
- RFC 791, Internet Protocol, §2.3 (addresses are four octets, 32 bits) (checked 20 Oct 2026)
- inet_aton(3), Linux manual page (a leading 0 makes a part octal, 0x hex; 2- and 3-part forms) (checked 20 Oct 2026)
- Python documentation, ipaddress (leading zeros rejected since 3.9.5 to avoid confusion with octal) (checked 20 Oct 2026)
- MySQL 8.4 Reference Manual, INET_ATON() and INET_NTOA() (store in INT UNSIGNED) (checked 20 Oct 2026)
- IANA IPv4 Special-Purpose Address Registry (0.0.0.0, loopback, private-use, limited broadcast) (checked 20 Oct 2026)
- RFC 1918, Address Allocation for Private Internets (checked 20 Oct 2026)
- RFC 4291, IP Version 6 Addressing Architecture, §2.2 (IPv6 addresses are written with colons) (checked 20 Oct 2026)
Need a custom dev tool for your team?
We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.
Built by CountryDevs · No signup · No ads · We count visits, never what you enter