IP Address Converter

Convert an IPv4 address between dotted decimal, a single integer, hex, octal, and binary. The IP address converter reads any of these forms and fills in all the others.

Updated
Converted in your browser. No address is looked up online.

Dotted (192.168.1.1), integer (3232235777), hex (0xC0A80101), binary, dotted octal, or ::ffff:192.168.1.1.

Dotted decimal
–
Decimal (32-bit integer)
–
Hexadecimal
–
Dotted hex
–
Dotted octal
–
Binary
–
IPv4-mapped IPv6
–
IPv4-mapped IPv6 (hex)
–
Reverse DNS name
–

How to use the IP Address Converter

  1. Type or paste the address into IPv4 address in any format: 192.168.1.1, 3232235777, 0xC0A80101, a binary string, or ::ffff:192.168.1.1.
  2. Check the line under the field. It says which format was detected.
  3. Copy the form you need from the list, such as the decimal value for a database column.

How it works

An IPv4 address is one 32-bit number written as four octets a.b.c.d. The converter turns it into that number and back:

integer = a × 16,777,216 + b × 65,536 + c × 256 + d
  • Hex and binary write the same integer in base 16 and base 2.
  • Dotted octal writes each octet in base 8 with a leading zero, a form older tools still accept.
  • IPv4-mapped IPv6 puts the 32 bits after ::ffff:, which is how dual-stack software shows IPv4 clients.
  • The reverse DNS name lists the octets backwards under in-addr.arpa, the name a PTR lookup uses.

Examples

  • 192.168.1.1 = 3232235777 = 0xC0A80101 = 11000000.10101000.00000001.00000001.
  • 10.0.0.1 = 167772161, dotted octal 0012.0000.0000.0001.
  • 0x08080808 = 8.8.8.8, reverse DNS 8.8.8.8.in-addr.arpa.
  • ::ffff:c0a8:101 = 192.168.1.1.

Limitations

  • A single integer must be between 0 and 4,294,967,295.
  • Dotted input with a leading zero, like 010.0.0.1, is only read as octal when every octet starts with 0. Otherwise it is rejected, because tools disagree on what it means.
  • IPv6 input is accepted only when it is an IPv4-mapped address. For other IPv6 forms, use IPv4 to IPv6.

Frequently asked questions

How do I convert an IP address to a decimal number?

Multiply the first octet by 16,777,216, the second by 65,536, the third by 256, and add the fourth. For 192.168.1.1 that gives 3,232,235,777.

Why store an IP address as an integer?

A 32-bit integer takes 4 bytes instead of up to 15 characters, and range checks become simple comparisons, which makes geo-IP and firewall lookups fast.

Can a browser open an IP written as a number?

Most browsers accept http://3232235777/ and treat it as 192.168.1.1. Many other programs don't, so the dotted form is safer to share.

Often used together with the IP Address Converter.