Developer tools

IP Address Converter

IP Address Converter

Convert IPv4 between dotted, integer, hex, binary and octal.

About this tool

About IP Address Converter

Databases, log files and firewall exports often store IPv4 addresses as a single number, a hex string or raw bits, and you need to see the familiar dotted form, or the reverse. Paste an address in any of these notations and the converter works out which one it is, then shows it as dotted decimal, an unsigned 32-bit integer, hex (0xC0A80001), dotted hex, binary in one string or in four octets, octal, dotted octal, an IPv4-mapped IPv6 address and the in-addr.arpa name used for reverse DNS. Put several addresses on separate lines and you get a table instead, which you can download as CSV for a spreadsheet or an import job. Inputs with leading zeros, like 010.0.0.1, are flagged because some systems quietly read them as octal and point to a different host. Invalid lines are listed with the reason instead of being skipped. Nothing is sent anywhere: the conversion is plain arithmetic done in your browser.

Built and maintained by Abhi JainUpdated

How to Convert an IP Address

  1. 1

    Paste addresses

    Type or paste one IPv4 address per line in the IP addresses box, in any notation, or click Sample.

  2. 2

    Check the detected format

    For one address you see the detected format and every conversion. For several you get a table.

  3. 3

    Copy or export

    Copy any single value, or download the table as CSV.

IP Address Converter: questions and answers

How do I convert an IP address to a number?

Multiply each octet by its place value and add them: a × 16,777,216 + b × 65,536 + c × 256 + d. For 192.168.0.1 that is 3,221,225,472 + 11,010,048 + 0 + 1 = 3,232,235,521.

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

Take the number apart in base 256: the first octet is n ÷ 16,777,216 (rounded down), then repeat with the remainder for 65,536 and 256; the last remainder is the fourth octet. Paste the integer here to do it instantly.

Why store IP addresses as integers?

An unsigned 32-bit integer takes 4 bytes instead of up to 15 characters, sorts in network order and makes range checks (BETWEEN start AND end) fast. MySQL's INET_ATON and INET_NTOA do the same conversion.

Why is 010.0.0.1 flagged?

Some parsers, including inet_aton used by ping on many systems, treat a leading 0 as octal, so 010 means 8 and the address becomes 8.0.0.1. Others read it as decimal 10. Avoid leading zeros to stay unambiguous.

What is an IPv4-mapped IPv6 address?

It is how a dual-stack system represents an IPv4 address inside IPv6: ::ffff: followed by the IPv4 address, for example ::ffff:192.168.0.1 (or ::ffff:c0a8:1 in hex).