IP Converter
Convert an IP address between dotted-decimal, binary, hexadecimal and decimal integer notation, in either direction. IPv4 and IPv6 are both supported, and the input format is detected automatically.
The four ways to write an IPv4 address
An IPv4 address is 32 bits. Those same 32 bits can be written in several notations, and different tools and systems expect different ones. All of them describe the identical address.
Dotted decimal 192.168.1.1 Dotted binary 11000000.10101000.00000001.00000001 Binary 11000000101010000000000100000001 Hexadecimal C0A80101 Hex with prefix 0xC0A80101 Decimal integer 3232235777 Octal 30052000401 Reverse DNS 1.1.168.192.in-addr.arpa
Read the pattern once and the conversions become mechanical. Each decimal octet maps to exactly 8 bits and exactly 2 hex digits, so all four notations are the same 32 bits regrouped.
Converting decimal to binary by hand
Use the place values 128, 64, 32, 16, 8, 4, 2, 1. Work left to right: if the remaining number is at least the place value, write a 1 and subtract; otherwise write a 0.
Example: converting 168 to binary
- 168 ≥ 128 → 1, remainder 40
- 40 < 64 → 0
- 40 ≥ 32 → 1, remainder 8
- 8 < 16 → 0
- 8 ≥ 8 → 1, remainder 0
- 0 < 4, 0 < 2, 0 < 1 → 000
Result: 10101000
Check: 128 + 32 + 8 = 168. The three leading digits 101 also reveal the address is in the class B range, since a first octet of 128–191 starts with 10.
Why decimal integers matter
Storing addresses as 32-bit integers is far more efficient than storing them as strings — comparisons and range queries become single instructions rather than string operations, and a range check reduces to WHERE ip BETWEEN start AND end. This is why geolocation databases, firewall rule engines and routing hardware all work with the integer form internally.
The conversion is a straightforward weighted sum, and this page performs it with unsigned 32-bit arithmetic so addresses above 127.255.255.255 do not appear as negative numbers — a classic bug in code that uses signed Java or C# integers.
Common mistakes
- Treating an octet with a leading zero as decimal. In some languages 010 is octal and equals 8, not 10. This is how 192.168.010.001 becomes a security problem, because it can bypass filters that match on the dotted string. The parser here rejects leading zeros instead.
- Using a signed 32-bit type. Addresses from 128.0.0.0 upward overflow into negative values, producing wrong results for half the internet.
- Confusing the reverse DNS zone with the reverse of the string. The name is reversed at the octet level and suffixed, not simply reversed character by character.
- Assuming hex is always 8 digits. If a tool shows a 4-digit value, that is a 16-bit number and not a full IPv4 address.
Frequently used conversions
| Description | Dotted | Binary (first octet) | Hex | Decimal |
|---|---|---|---|---|
| Unspecified / default route | 0.0.0.0 | 00000000 | 00000000 | 0 |
| Loopback | 127.0.0.1 | 01111111 | 7F000001 | 2130706433 |
| First RFC 1918 range | 10.0.0.0 | 00001010 | 0A000000 | 167772160 |
| RFC 1918 172.16 block | 172.16.0.0 | 10101100 | AC100000 | 2886729728 |
| Common home gateway | 192.168.1.1 | 11000000 | C0A80101 | 3232235777 |
| 192.168.0.1 variant | 192.168.0.1 | 11000000 | C0A80001 | 3232235521 |
| Google DNS | 8.8.8.8 | 00001000 | 08080808 | 134744072 |
| Google DNS secondary | 8.8.4.4 | 00001000 | 08080404 | 134743044 |
| Cloudflare DNS | 1.1.1.1 | 00000001 | 01010101 | 16843009 |
| Quad9 DNS | 9.9.9.9 | 00001001 | 09090909 | 151587081 |
| Link-local (APIPA) | 169.254.0.0 | 10101001 | A9FE0000 | 2851995648 |
| Broadcast | 255.255.255.255 | 11111111 | FFFFFFFF | 4294967295 |
Individual conversion steps have their own pages: IP to binary, binary to IP, IP to hex, hex to IP, IP to decimal and decimal to IP.
Frequently asked questions
How do I convert an IP address to binary?
Convert each of the four octets to its own 8-bit binary value and join them with dots. For 192.168.1.1: 192 is 11000000, 168 is 10101000, 1 is 00000001 and 1 is 00000001, giving 11000000.10101000.00000001.00000001. Each octet is independent, so you can convert them in any order.
How do I convert an IP address to hexadecimal?
Convert each octet to two hex digits and concatenate them without dots. For 192.168.1.1 the octets become C0, A8, 01 and 01, giving C0A80101. Many tools display this with a 0x prefix or with dots between octets, but the compact eight-digit form is the most common.
How do I convert an IP address to a decimal integer?
Treat the 32 bits as a single unsigned binary number. For 192.168.1.1 the calculation is 192 × 16,777,216 + 168 × 65,536 + 1 × 256 + 1 = 3,232,235,777. Decimal integers are used by WHOIS databases, geolocation APIs and firewall rules that store addresses as numbers.
Why is the maximum decimal IPv4 value 4,294,967,295?
An IPv4 address is 32 bits, and the largest unsigned 32-bit value is 2^32 − 1 = 4,294,967,295, which corresponds to 255.255.255.255. Anything larger does not fit in 32 bits. This is also why 32-bit signed integers cannot hold IPv4 addresses safely — the top half overflows into negative numbers.
What is the reverse DNS name for an IP address?
Reverse DNS reverses the octets and appends in-addr.arpa, so 8.8.4.4 becomes 4.4.8.8.in-addr.arpa. IPv6 does the same at nibble granularity with the ip6.arpa suffix. These names are what PTR records are registered under, and they are what mail servers look up to verify a sending host.
How do I convert hexadecimal back to an IP address?
Split the eight hex digits into four pairs, then convert each pair to decimal. For C0A80101: C0 is 192, A8 is 168, 01 is 1 and 01 is 1, giving 192.168.1.1. If your value has fewer than eight digits, pad it with leading zeros first — a 4-digit value is only 16 bits, not a full address.
Can I convert an IPv6 address to decimal?
Yes, and this page does. The result is a 128-bit integer, which is a 39-digit decimal number for most addresses. Note that many tools cannot handle values this large — a 64-bit integer is not enough, so the value must be held in a BigInt or an arbitrary-precision type.