IP Address Converter

Convert an IP address between dotted decimal, integer, hexadecimal, binary and IPv6 formats, or turn a number back into an IP address.

  • Free
  • No sign-up
  • Works on phone and computer

Guide

This converter shows one IP address in every common notation at once: dotted decimal, a single integer, hexadecimal, binary, dotted octal and hex, IPv4-mapped IPv6 and its reverse DNS name. It also works backwards, turning an integer, a hex value or a string of bits into a normal IP address. IPv4 and IPv6 are both supported.

How to use it

  1. Type or paste a value into the box. Any of these works: 8.8.8.8, 134744072, 0x08080808, 32 or 128 binary digits (dots, spaces and colons are ignored), or an IPv6 address such as 2001:db8::ff00:42:8329.
  2. Press Convert, or click your IP under the box to convert the address you are browsing from.
  3. Use the copy button next to any row to grab that format.

You can paste an address straight from a log line with a port, such as 8.8.8.8:53 or [2001:db8::1]:443; the port is dropped.

Reading the results: a worked example

For 8.8.8.8 the table shows:

RowValueWhere you meet it
Integer (decimal)134744072Databases and geolocation files that store addresses as numbers so range searches are fast.
Hexadecimal0x08080808Packet captures, /proc/net tables on Linux and some firewall logs.
Binary00001000.00001000.00001000.00001000Working out subnet masks by hand: each 1 in a mask marks a network bit.
Octal (dotted) / Hex (dotted)010.010.010.010 / 08.08.08.08Old software and URL tricks; see the security note below.
IPv4-mapped IPv6::ffff:8.8.8.8How dual-stack servers and logs often show IPv4 clients.
6to4 prefix2002:0808:0808::/48The prefix the old 6to4 tunnelling scheme derived from an IPv4 address (deprecated, RFC 7526).
ClassAThe pre-1993 classful label from the first octet.
Reverse DNS name8.8.8.8.in-addr.arpaThe name a PTR record lives under.
Address typePublicPublic, Private, Loopback, Link-local, Multicast, Carrier-grade NAT or Reserved.

For an IPv6 address you get the compressed form, the integer (up to 39 digits), the 32-digit hex value, the binary groups, the fully expanded form and the ip6.arpa reverse name. If the address is IPv4-mapped, such as ::ffff:192.0.2.1, an extra Embedded IPv4 row shows 192.0.2.1.

How the conversion works

An IPv4 address is one 32-bit number split into four bytes. Multiply each octet by its place value and add them up: a × 256³ + b × 256² + c × 256 + d. For 8.8.8.8 that is 8 × 16,777,216 + 8 × 65,536 + 8 × 256 + 8 = 134,744,072. To go back, divide by 256 repeatedly and keep the remainders. In hex each octet becomes exactly two digits, which is why 192.168.0.1 reads as C0 A8 00 01.

IPv6 addresses can be shortened: leading zeros in each group are dropped and one run of all-zero groups becomes ::. So 2001:0db8:0000:0000:0000:0000:0000:0001 is written 2001:db8::1. The rules for the shortest form are in RFC 5952. Learn more about IPv6.

Practical scenarios

  • A database column holds numbers, not addresses. Paste the number to see which IP it is. MySQL's INET_ATON() and INET_NTOA() use the same integer form.
  • A log or capture shows hex. Enter it with the 0x prefix, for example 0xC0A80001, to get 192.168.0.1.
  • Your server logs show ::ffff: addresses. The client connected over IPv4 to a dual-stack socket. The embedded IPv4 row gives you the address to look up with IP lookup.
  • You need to set up a PTR record. Copy the reverse DNS name, then confirm it later with the reverse DNS lookup.
  • You want the mask in binary as well. Use the subnet calculator, which shows the address and the mask bit by bit.
Security note: browsers and many libraries accept unusual IP formats such as http://2130706433/ (which is 127.0.0.1) or octal octets. Attackers use these to bypass naive filters, so always normalise addresses before validating them.

Limits

  • Dotted addresses with leading zeros, such as 192.168.001.1, are rejected on purpose: some software reads 010 as octal 8 and some as decimal 10, so the meaning is ambiguous.
  • Integers from 0 to 4,294,967,295 are read as IPv4. Anything larger is read as IPv6, so 4294967296 becomes ::1:0:0.
  • Short forms such as 127.1 or a hex value without 0x are not accepted.
  • Binary input must be exactly 32 or 128 bits.

The conversion is arithmetic on our server; nothing is looked up or stored.

Frequently asked questions

Can I enter binary?

Yes. Enter exactly 32 bits for IPv4 or 128 bits for IPv6, with or without dots, spaces or colons between the groups.

What is the largest IPv4 number?

4294967295, which is 255.255.255.255 (2³² − 1). Enter a larger number and the converter treats it as an IPv6 address.

How do I convert an IP address to an integer?

Enter the address and read the Integer (decimal) row. By hand, compute a × 16,777,216 + b × 65,536 + c × 256 + d, so 192.168.0.1 becomes 3,232,235,521.

Why does a URL like http://2130706433/ open localhost?

Browsers accept an IPv4 address written as one integer, and 2130706433 is 127.0.0.1. Paste it here to see. This is why input filters should convert addresses to a standard form before checking them.

What does ::ffff: in front of an IP address mean?

It is an IPv4-mapped IPv6 address (RFC 4291): software that speaks IPv6 uses it to represent an IPv4 client. ::ffff:203.0.113.5 simply means the IPv4 address 203.0.113.5.

Updated

Comments

Share a tip, ask a question or tell others how the tool worked for you.
Copied to clipboard