Công Cụ Nhanh

IP Address Converter: decimal, integer, hex, binary and IPv6

IPv4 (192.168.1.1), integer (3232235777), hex (0xC0A80101), 32-bit binary, dotted octal / hex, or IPv6.

Try:
Enter an IP address to see every notation: dotted decimal, integer, hex, binary, octal, the matching IPv6 forms and the reverse-DNS name.

Processed in your browser. Your files and data are never uploaded to a server.

Quick answer

Paste an IP address in any form (192.168.1.1, 3232235777, 0xC0A80101, a 32-bit binary string or IPv6): the tool detects the format and converts it to dotted decimal, integer, hex, binary, octal, the IPv4-mapped form ::ffff:c0a8:101, the 6to4 prefix and the reverse PTR name. For IPv6 it also reveals any embedded IPv4 address (6to4, NAT64, Teredo).

Why can one IP be written in so many ways?

The same IP address is stored and displayed in many ways: databases keep integers for fast range checks, firewall logs print hex, networking courses teach binary, IPv6 software writes ::ffff:a.b.c.d. This converter switches between all of them in your browser without sending anything to a server, and flags unusual forms such as 0300.0250.1.1 (octal), which browsers still read as 192.168.1.1, a trick often used to disguise malicious links.

Illustration of a round dial in the centre with four arrows out to four cards, each showing the same value in a different pattern

How to convert an IP address

  1. 1

    Paste the address: dotted (192.168.1.1), integer (3232235777), hex with 0x, a 32- or 128-bit binary string, or an IPv6 address.

  2. 2

    Check the “Detected as” line to confirm the format was understood, along with the address type (private, public, CGNAT…).

  3. 3

    Read the result table and copy the form you need, for example the integer for an SQL query or the hex to search a log.

  4. 4

    For IPv6, look at “Embedded IPv4” when the address is IPv4-mapped, 6to4, NAT64 or Teredo.

One address, many notations (example 192.168.1.1)

NotationValueWhere you see it
Dotted decimal192.168.1.1Router and OS settings
32-bit integer3232235777MySQL INT UNSIGNED (INET_ATON), GeoIP databases
Hex0xC0A80101Firewall logs, packets, C code
Dotted hexc0.a8.01.01Packet capture tools
Binary11000000.10101000.00000001.00000001Subnetting lessons
Octal (inet_aton)0300.0250.01.01Disguised links
IPv4-mapped IPv6::ffff:192.168.1.1 = ::ffff:c0a8:101IPv6 sockets accepting IPv4
Reverse (PTR)1.1.168.192.in-addr.arpaReverse DNS records

IPv4 embedded in IPv6

RangeMechanismWhere the IPv4 sits
::ffff:0:0/96IPv4-mapped (RFC 4291)Last 32 bits
::/96IPv4-compatible (deprecated)Last 32 bits
2002::/166to4 (RFC 3056)Bits 16–47, right after 2002:
64:ff9b::/96NAT64 (RFC 6052)Last 32 bits
2001::/32Teredo (RFC 4380)Last 32 bits, inverted (XOR 0xFFFFFFFF)

Worked examples

Filtering an IP range in MySQL

Convert 10.0.0.0 and 10.255.255.255 to 167772160 and 184549375, then use WHERE ip BETWEEN 167772160 AND 184549375 on a column stored with INET_ATON.

Reading an address in an app log

A Node.js or Java log shows ::ffff:113.161.10.20: that is an IPv4 client 113.161.10.20 arriving on an IPv6 socket, not an IPv6 client.

Checking a suspicious link

http://3232235777/ or http://0xC0A80101/ actually point to 192.168.1.1. Paste the host part here to see the real address before clicking.

Finding the IPv4 behind NAT64

64:ff9b::7f00:1 carries 127.0.0.1 in its last 32 bits; the tool shows NAT64 → 127.0.0.1 straight away.

Common problems

An integer comes out as an IPv6 address.
IPv4 has only 32 bits (0 – 4,294,967,295). Larger values are read as a 128-bit IPv6 integer; check the number for extra digits.
010.1.1.1 turns into 8.1.1.1.
Under inet_aton rules an octet with a leading 0 is octal, so 010 = 8. Avoid leading zeros in configs to prevent surprises.
A binary string isn't accepted.
It needs exactly 32 bits (IPv4) or 128 bits (IPv6); dots and spaces between groups are ignored. Pad with leading zeros if needed.
The IPv6 hex looks different from the colon form.
It is the same 128-bit number: hex writes all 32 digits together, while RFC 5952 splits 8 groups and compresses zeros.

Why a browser treats 3232235777 as an IP address

The operating system's inet_aton (and the WHATWG URL standard browsers follow) accepts IPv4 as a single integer, hex with 0x, octal with a leading 0, or fewer than four parts (192.168.257 = 192.168.1.1). Attackers use this to hide links to internal hosts or slip past filters that only block dotted notation.

The tool labels such input as “inet_aton” so you can see the real address before opening it or adding it to a blocklist.

Storing IPs in a database

Storing IPv4 as an unsigned 32-bit integer makes range comparisons and indexes faster than strings. MySQL has INET_ATON / INET_NTOA for IPv4 and INET6_ATON / INET6_NTOA (VARBINARY(16)) for both families; PostgreSQL has native inet and cidr types.

Glossary

Octet
A group of 8 bits (0–255); IPv4 has four, separated by dots.
inet_aton
The function that parses IPv4 text, also accepting integer, hex and octal forms.
IPv4-mapped
::ffff:a.b.c.d, how IPv6 software represents an IPv4 connection.
6to4
A legacy mechanism carrying IPv6 over IPv4; each public IPv4 gets the prefix 2002:xxxx:xxxx::/48.
NAT64
A gateway that lets IPv6-only hosts reach IPv4 servers, using the prefix 64:ff9b::/96.
PTR
A reverse DNS record giving the name for an IP address.

Frequently asked questions

How do I convert an IP to an integer?

Multiply each octet by a power of 256: a×16,777,216 + b×65,536 + c×256 + d. For example 192.168.1.1 = 192×16,777,216 + 168×65,536 + 1×256 + 1 = 3,232,235,777.

Is ::ffff:192.168.1.1 a real IPv6 address?

It is how IPv6 software represents an IPv4 address and is not used as an address on the Internet. In a log, read it as the IPv4 client 192.168.1.1.

Does it accept IPv6 as an integer?

Yes, for numbers larger than 32 bits. Results also include the 128-bit integer for any IPv6 address you enter.

Is the octal form 0300.0250.1.1 valid?

It is valid for inet_aton and browsers open it, but avoid it in configs because it is easily misread. The tool converts it so you can see the real address.

Does it work offline?

Yes. Every conversion runs in your browser and nothing is sent anywhere.

How do I get the network range for an address?

Use the IPv4 or IPv6 Subnet Calculator; to turn a start – end range into CIDR blocks, use IP Range to CIDR.

Ratings and comments

Loading…