What is an IPv4 address converter?
An IPv4 address is a 32-bit number. People write it as four decimal numbers separated by dots (192.168.1.1, the dotted-decimal form), but the same address can be written as a single integer (3232235777), as hexadecimal (C0A80101), as binary, in dotted octal or as an IPv6 address mapped from IPv4 (::ffff:c0a8:0101). An IP to decimal converter shows every one of these forms at once so you can move between them without doing the arithmetic.
You need this when a log, a database or an API stores the address as an integer (INET_ATON in MySQL, inet_aton in C, many IP-geolocation databases), when you read an address in a packet capture in hex, when a firewall or a URL uses the decimal form, or when you are studying how subnets work at the bit level. It is also useful for security work: addresses such as http://3232235777/ or http://0300.0250.0001.0001/ open the same host as 192.168.1.1 and are used to disguise links, so being able to decode them quickly is handy.
The converter accepts dotted decimal, a decimal integer, hexadecimal with the 0x prefix, binary (0b... or 32 digits) and dotted octal. Everything is computed in your browser and nothing is stored: the page always opens with an example.
How to convert an IP address
- Type or paste the address in the single input field. You can start from any form:
192.168.1.1,3232235777,0xC0A80101, a 32-digit binary number or0300.0250.0001.0001. - The result lists the dotted address, the decimal integer, the hexadecimal value, the binary value and two IPv6 forms (the full IPv4-mapped address and its short form).
- Press the copy button next to any row to put that value on the clipboard.
- If the input is invalid, the field turns red and explains the accepted formats. If you wrote a part with a leading zero, a note tells you the address was read as octal.
Examples
A private address in every form
Input 192.168.1.1:
Decimal : 3232235777
Hex : C0A80101
Binary : 11000000101010000000000100000001
IPv6 : 0000:0000:0000:0000:0000:ffff:c0a8:0101
Short : ::ffff:c0a8:0101Google public DNS
8.8.8.8 is 134744072 in decimal and 8080808 in hex (the tool does not pad the hex or the binary, so leading zeros are not shown).
From integer to dotted
Typing 3232235777 gives back 192.168.1.1. The conversion is (192 × 256³) + (168 × 256²) + (1 × 256) + 1.
Loopback
127.0.0.1 equals 2130706433, hex 7F000001.
Dotted octal
0300.0250.0001.0001 is read as octal, because a part with a leading zero is octal (this is how ping and curl read it): 0300 = 192, 0250 = 168, so the result is 192.168.1.1.
Common mistakes
- A part above 255 (
192.168.1.256). Each of the four parts is one byte, from 0 to 255. - Fewer than four parts (
192.168.1). Some old tools accept this shorthand, but the standard form needs all four. - Leading zeros (
192.168.001.001). Some systems read010as octal 8, not decimal 10. Remove the zeros if you meant decimal. - Hexadecimal without the
0xprefix.C0A80101alone is not read as hex; write0xC0A80101. - Integer above 4,294,967,295: it does not fit in 32 bits, so it is not an IPv4 address.
- Mixing up byte order. Network order is big-endian. Some systems show the same address as little-endian (
0x0101A8C0), which is a different number.
Frequently asked questions
How do I convert an IP address to decimal?
Multiply each part by a power of 256 and add: a × 16,777,216 + b × 65,536 + c × 256 + d. For 192.168.1.1 the result is 3,232,235,777.
What is an IPv4-mapped IPv6 address?
It is a way to write an IPv4 address inside the IPv6 space, with the prefix ::ffff: followed by the 32 bits of the address (RFC 4291). ::ffff:c0a8:0101 is 192.168.1.1.
Is the integer form of an IP safe to share?
It is the same address, just written differently. Because it hides the dots, it appears in phishing links, so do not trust a link only because it looks unfamiliar.
How many IPv4 addresses exist?
2^32 = 4,294,967,296 values, from 0.0.0.0 to 255.255.255.255, although many are reserved.
How do I find the network of an address?
Use the subnet calculator. For bases other than the IP formats, use the integer base converter.
How do I turn a range into CIDR blocks?
The IPv4 range expander lists the minimal blocks that cover a start and end address.