IP Integer Converter
Convert between IPv4 addresses and 32-bit integer representations
Input
Output
Guide
How does an IP address become a number?
An IPv4 address is a 32 bit number written as four parts from 0 to 255. To get the integer, multiply the first part by 16,777,216, the second by 65,536 and the third by 256, then add them up with the fourth. So 192.168.1.1 is 3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777. Databases often store addresses this way, and MySQL's INET_ATON() and INET_NTOA() functions do the same conversion.
Tool description
Type an IPv4 address into IP Address, and Integer shows its number as you type, ready to copy. The swap button turns the conversion around, so you can type an integer and get the address back. The tool starts on IP Address to Integer, and Insert sample fills in 192.168.1.1.
An address needs four parts from 0 to 255, and an integer must be between 0 and 4,294,967,295, the range of a 32 bit unsigned number. Anything else shows an error.
Features
- Converts IPv4 addresses to integers and back
- Swap button that turns the conversion around, result included
- Covers every address from 0.0.0.0 to 255.255.255.255
Examples
| IP address | Integer |
|---|---|
| 0.0.0.0 | 0 |
| 10.0.0.1 | 167772161 |
| 127.0.0.1 | 2130706433 |
| 192.168.1.1 | 3232235777 |
| 255.255.255.255 | 4294967295 |
Good to know
- Type the integer as plain digits, without commas, spaces or a 0x prefix. The tool stops reading at the first character that isn't a digit, so 3,232,235,777 becomes 0.0.0.3.
- IPv6 addresses aren't supported, as they are 128 bit numbers.
- The conversion runs in your browser and nothing is sent anywhere.