IP address converter
Enter an IP in any format (dotted, decimal, binary or hexadecimal) and see every other form of it.
- Dotted decimal
- 192.168.1.1
- Integer (decimal)
- 3232235777
- Hexadecimal
- 0xC0A80101
- Hexadecimal per octet
- C0.A8.01.01
- Binary
- 11000000.10101000.00000001.00000001
- Octal per octet
- 0300.0250.01.01
- IPv4-mapped IPv6
- ::ffff:192.168.1.1
- 6to4 prefix
- 2002:c0a8:101::/48
- Reverse DNS (PTR)
- 1.1.168.192.in-addr.arpa
- Class
- C
- Address type
- Private (RFC 1918)
How to convert an IP address
Enter the address as you have it: 192.168.1.1, a number like 3232235777, a hex value like 0xC0A80101 or the 32 bits in binary.
Click «Convert»: the format is detected automatically.
Copy the form you need: binary to work out subnets by hand, decimal for a database, hexadecimal for a packet dump.
An IP address is a number
An IPv4 address is 32 bits, that is, an integer between 0 and 4,294,967,295. The form 192.168.1.1 is just a convenient way to write it: the number is split into four bytes (octets) and each one is written in decimal.
To go from dotted form to an integer, multiply each octet by its weight: 192 × 16,777,216 + 168 × 65,536 + 1 × 256 + 1 = 3,232,235,777. To go back, divide by 256 repeatedly and keep the remainders. The converter does both instantly.
Binary and hexadecimal: what they are for
- Binary: this is how a router «sees» the address. With all 32 bits in view you can tell which part is the network and which is the host for a given mask, and it is how you calculate subnets by hand.
- Hexadecimal: each octet is two digits (192 = C0, 168 = A8). Addresses appear this way in packet captures (Wireshark, tcpdump), memory dumps and some configuration files.
- Decimal (integer): handy for storing IPs in a database, sorting them or checking whether one falls within a range with a simple comparison.
- Octal: rarely used, but many programs accept 0300.0250.0001.0001 as 192.168.1.1, and it sometimes shows up in attempts to bypass filters.
IPv4 inside IPv6
There are several ways to represent an IPv4 address inside an IPv6 one, and the converter shows the most common:
- IPv4-mapped (::ffff:192.168.1.1): used by operating systems when an IPv6 application accepts an IPv4 connection. It is what you sometimes see in server logs.
- 6to4 (2002:c0a8:101::/48): an old transition mechanism that derives a whole IPv6 prefix from a public IPv4 address.
If you enter an IPv6 address that carries an IPv4 one inside, the converter extracts it and shows it in its own row.
IPv6 formats
An IPv6 address is 128 bits, written as eight groups of four hexadecimal digits. The expanded form writes them all (2001:0db8:0000:0000:0000:0000:0000:0001) and the compressed form drops leading zeros and replaces the longest run of zero groups with «::» (2001:db8::1). Both represent exactly the same address.
The converter also shows the 128-bit integer in decimal and hexadecimal, the binary grouped in 16-bit blocks and the ip6.arpa name used for reverse DNS.
Frequently asked questions
How do I convert an IP to an integer?
Multiply the first octet by 16,777,216, the second by 65,536, the third by 256 and add the fourth. For example, 10.0.0.1 is 167,772,161. Or type it into the converter and see it directly.
Why does ping 3232235777 reply as 192.168.1.1?
Because most systems accept an IP written as a single integer. It is the same address written another way, just like 0xC0A80101 in hexadecimal.
What is the reverse DNS name shown in the result?
It is the name under which the PTR record of that IP is looked up: the octets reversed followed by in-addr.arpa (or the hex digits reversed and ip6.arpa for IPv6). It tells you which hostname an IP is assigned.
Can an IPv6 address be converted to IPv4?
Only if it carries an IPv4 address inside, like mapped (::ffff:1.2.3.4) or 6to4 addresses. A regular IPv6 address has no IPv4 equivalent: they are separate address spaces.