IP Address Converter

Type an IPv4 address in any form and see it in all the others. Dotted decimal, a whole number such as 3232235777, hex like 0xC0A80101, 32 binary digits or an IPv4-mapped IPv6 address all work as input. You get the integer, hex, binary, dotted octal, IPv4-mapped IPv6, the 6to4 prefix and the reverse DNS name.

Calculator

Dotted decimal, a whole number, 0x hex, 32 binary digits, or IPv4-mapped IPv6 (::ffff:...).

Dotted decimal192.168.1.1
Integer3232235777
Hex0xC0A80101
Dotted hexc0.a8.01.01
Binary11000000.10101000.00000001.00000001
Dotted octal0300.0250.01.01
IPv4-mapped IPv6::ffff:192.168.1.1
IPv4-mapped IPv6 (hex)::ffff:c0a8:101
6to4 prefix2002:c0a8:0101::/48
Reverse DNS (PTR)1.1.168.192.in-addr.arpa

Every calculation runs in your browser. What you type never leaves this device.

Features

  • Reads dotted decimal, integer, 0x hex, binary or ::ffff: mapped IPv6

  • Integer form for databases and IP geolocation lookups

  • Hex, dotted hex, binary and dotted octal forms

  • IPv4-mapped IPv6 in both dotted and hex notation

  • in-addr.arpa name for PTR records

  • Rejects leading zeros, which some tools silently read as octal

When you need another form of an IP

Storing IPs in a database

Save IPv4 addresses as unsigned integers for compact storage and fast range queries, and convert them back when reading logs.

IP geolocation and range files

Many GeoIP and ASN datasets list ranges as integers. Convert them to see which addresses they mean.

Dual-stack servers and logs

Recognise ::ffff:10.0.0.5 in application logs as a plain IPv4 client connecting to an IPv6 socket.

Learning and debugging

See an address in binary to understand masks, or decode a hex address from a packet capture.

How the forms relate

An IPv4 address is one 32-bit number

Each of the four parts is one byte. 192.168.1.1 is 192 x 16,777,216 + 168 x 65,536 + 1 x 256 + 1 = 3,232,235,777. Hex and binary are the same number written in base 16 and base 2. MySQL's INET_ATON() and INET_NTOA() do this conversion; PostgreSQL has a native inet type instead.

IPv4 inside IPv6

  • ::ffff:a.b.c.d is an IPv4-mapped address: how an IPv6 socket shows a client that connected over IPv4.
  • 2002:xxxx:xxxx::/48 is the 6to4 prefix built from an IPv4 address; 6to4 is deprecated but still appears in old configs.
  • Reverse DNS for IPv4 lives under in-addr.arpa with the four parts reversed.

IP Address Converter - FAQ