An IPv4 address is usually written as four numbers separated by dots, but underneath it is a single 32-bit number. This tool converts between the two forms. Enter 192.168.1.1 and it returns 3232235777. Enter 3232235777 and it returns 192.168.1.1.
The conversion is done by your browser, and the page shows "Processed in your browser". The value you type is not sent to the IP Tracker server.
How to convert an address or a number
- Type a dotted IPv4 address such as
192.168.1.1, or a whole number from 0 to 4294967295. - Click Calculate. There is no direction to choose: an address is turned into a number and a number into an address.
- Read the two rows of the result, IPv4 and Decimal.
- To keep the result, use "View as JSON", Copy JSON or Download JSON under the rows.
Write the number as digits only, without spaces, commas or dots. Numbers above 4294967295 are rejected, because there is no IPv4 address beyond 255.255.255.255. Addresses in which an octet has a leading zero, such as 192.168.01.1, are rejected too.
How to read the result
The result has two rows. IPv4 holds the address in dotted form, and Decimal holds the same address as one whole number. Whichever of the two you entered, the other row is the answer.
The two forms are the same value written differently. Nothing is looked up, and the result says nothing about where an address is or who uses it.
The formula, with a worked example
Each of the four parts of an address is called an octet and stands for 8 bits, so it runs from 0 to 255. The first octet is the most significant, like the leftmost digit of an ordinary number. To get the decimal value, multiply each octet by its place value and add the results.
The four products add up to 3232235777.
The place values are powers of 256 because each octet can take 256 different values. In effect, the dotted form is the number written in base 256, with each octet as one digit. Raising the last octet by one adds 1 to the number, and raising the third octet by one adds 256.
Going back is a series of divisions. Divide the number by 16777216: the whole part is the first octet and the remainder carries on. 3232235777 divided by 16777216 is 192, with 11010305 left over. Divide 11010305 by 65536 to get 168, remainder 257. Divide 257 by 256 to get 1, remainder 1. That last remainder is the fourth octet, which gives 192.168.1.1.
There is a shortcut if you know hexadecimal. Each octet is exactly two hexadecimal digits: 192 is C0, 168 is A8 and 1 is 01. Written together, C0A80101 is the same number as 3232235777.
Why software stores addresses as numbers
A dotted address is text, and text is awkward for a program to work with. The numeric form has practical advantages.
- It is compact. The number fits in 4 bytes, while the text form needs up to 15 characters.
- It sorts correctly. Sorted as text,
10.0.0.10 comes before 10.0.0.9, because the comparison goes character by character and "1" comes before "9". As numbers, 167772169 comes before 167772170. - It makes range checks cheap. An address belongs to a block if its number lies between the first and the last number of the block.
192.168.1.0/24 runs from 3232235776 to 3232236031, so two comparisons answer the question.
Databases and firewalls work this way internally. Some IP location data files list every range as a starting number and an ending number, and you need the conversion to read them. MySQL has the functions INET_ATON and INET_NTOA for the two directions.
One trap is the signed integer. A signed 32-bit field holds values only up to 2147483647, which is the address 127.255.255.255. Every address from 128.0.0.0 upward overflows it and shows up as a negative number: 192.168.1.1 becomes -1062731519. If you see negative values in an address column, the field should have been an unsigned 32-bit integer or a 64-bit integer. Adding 4294967296 to the negative value gives the number this tool expects.
Working with ranges of addresses
A block of addresses is a continuous run of numbers, so range work becomes plain arithmetic. Take the documentation block 203.0.113.0/24. Its first address converts to 3405803776, and its last address, 203.0.113.255, converts to 3405804031.
- A database query for every row in the block needs only those two values, as in
WHERE ip BETWEEN 3405803776 AND 3405804031. - Subtracting the first number from the last and adding one gives the size of the block, which is 256 addresses here.
- The difference between any two numbers says how far apart the addresses are. Two neighboring
/24 blocks start exactly 256 apart.
To find the first and last address of a block in the first place, use IPv4 Calculator and convert its Network and Broadcast rows.
Decimal addresses in links
Browsers accept the numeric form in a web address. A link to http://3232235777/ is treated as a link to http://192.168.1.1/. This is old behavior that still works, and it is sometimes used to disguise where a link goes.
A number in a link does not look like an address, so a reader may not recognize it, and a filter that searches for dotted addresses or known domain names can miss it. A common variation puts a familiar name in front of an @ sign, as in https://example.com@3405803786/login. Everything before the @ is a username, which most servers ignore. The real host is the number after it, 203.0.113.10 in this case.
If you find a long number where a hostname should be, convert it here to see the address, then look that address up with IP Lookup to see which network it belongs to. URL Parser splits a full link into its parts and shows the hostname separately from any username.
The same trick exists in other number bases. Browsers also accept a hexadecimal host such as 0xC0A80101, and octal forms, and convert them in the same way. This tool converts the decimal form only.
Ordinary websites almost never link by a numeric address of this kind, so treat such a link as a warning sign.
Situations where the conversion helps
- A log file or database export shows addresses as large numbers and you need to read them.
- You are writing a query that selects all addresses in a block and need the numeric start and end.
- An address column contains negative numbers and you want to know which addresses they stand for.
- A suspicious link or script contains a long number in place of a hostname.
- You are comparing two lists of addresses, one in each format.
What this tool does not do
It converts IPv4 only. An IPv6 address is 128 bits long, so its numeric form has up to 39 digits and does not fit the integer types most software uses. IPv6 addresses are handled as hexadecimal text instead, and IPv6 Expander writes one out in full.
The output is decimal. The tool does not show hexadecimal, octal or binary forms. Octets with leading zeros are rejected. That form is ambiguous, because some programs read an octet that starts with 0 as an octal number, in which case 010.0.0.1 means 8.0.0.1.
It converts one value at a time and does no lookup. It cannot tell you whether an address is in use or who operates it.
Frequently asked questions
How do I convert an IP address to a decimal number by hand?
Multiply the first octet by 16777216, the second by 65536 and the third by 256. Add those three results and the fourth octet.
For 8.8.8.8 that is 134217728 + 524288 + 2048 + 8, which is 134744072.
Why is 4294967295 the largest number allowed?
An IPv4 address has 32 bits, and 32 bits can hold 4,294,967,296 different values. Counting starts at 0, so the highest value is 4294967295, which is the address 255.255.255.255.
Why does the tool reject an address like 192.168.01.1?
Because of the leading zero in 01. Some software reads an octet with a leading zero as octal, so the same text can mean different addresses in different programs. Write each octet without leading zeros: 192.168.1.1.
Can I open a website by typing its decimal IP address?
A browser will accept the number and connect to the matching address. Whether the site appears is another matter. Many servers host several sites on one address and choose between them by the hostname in the request, and a certificate is issued for a name, not for a number.
Without the hostname you often get a default page, an error or a certificate warning.
Is the decimal form the same as an integer IP or a long IP?
Yes. Integer IP, IP number, long IP and decimal IP are different names for the same 32-bit value. The word long refers to the long integer type that programs traditionally stored it in, as in the PHP functions ip2long and long2ip.
Does this tool convert IPv6 addresses?
No. It accepts IPv4 addresses and whole numbers from 0 to 4294967295. IPv6 addresses are written in hexadecimal and are rarely converted to decimal at all.
What address is the number 2130706433?
It is 127.0.0.1, the loopback address that a computer uses to talk to itself. The decimal form is sometimes used to get past filters that look for 127.0.0.1 or localhost in a web address.
Is the address I enter sent anywhere?
No. The conversion happens in your browser and the input is not sent to the IP Tracker server. IP Tracker does not keep a history of what visitors look up.