IP to Decimal Converter |
The direction is detected from what you paste. One per line for many; results update as you type.
How to Convert an IP Address to Decimal
An IPv4 address is a 32-bit number: 192.168.1.1 = 192×256³ + 168×256² + 1×256 + 1 = 3232235777. This tool converts both ways, for IPv4 and IPv6, and shows the forms databases use.
Multiply each octet by 256³, 256², 256 and 1 and add them:
| Octet | Place value | Product |
|---|---|---|
| 192 | 256³ = 16,777,216 | 3,221,225,472 |
| 168 | 256² = 65,536 | 11,010,048 |
| 1 | 256 | 256 |
| 1 | 1 | 1 |
| Total | 3,232,235,777 | |
How to Convert a Decimal Number Back to an IP
Divide by 256 repeatedly and read the remainders backwards, or paste the number above.
3232235777 ÷ 256 = 12625921 remainder 1; ÷ 256 = 49319 remainder 1; ÷ 256 = 192 remainder 168. Reading 192, then the remainders from last to first, gives 192.168.1.1. Numbers from 4294967296 up to 39 digits are read as IPv6, and negative numbers as signed 32-bit values.
Storing IP Addresses in a Database
Store IPv4 as an unsigned 32-bit integer (INT UNSIGNED) or use native types like PostgreSQL inet; IPv6 needs 128 bits.
| Database | How |
|---|---|
| MySQL / MariaDB | INET_ATON('192.168.1.1') → 3232235777 in an INT UNSIGNED column; INET_NTOA() back. For IPv6: INET6_ATON() into VARBINARY(16). |
| PostgreSQL | The inet type stores IPv4 and IPv6 and supports subnet operators: '192.168.1.1'::inet << '192.168.0.0/16'. '192.168.1.1'::inet - '0.0.0.0'::inet gives 3232235777. |
| Java, C#, signed INT columns | A signed 32-bit integer holds 192.168.1.1 as -1062731519. Use a 64-bit (long) value, or add 4294967296 to negative values. |
Integers make range checks fast (BETWEEN on the start and end of a block); native types are clearer and handle IPv6.
Decimal IPs in Links (a Phishing Trick)
Browsers accept http://3232235777/; decimal hosts can hide where a link goes.
Browsers follow the URL standard, which reads a host made of numbers as an IPv4 address in decimal, hex (0xC0A80101), octal (0300.0250.01.01) or shortened forms (192.168.257). All of these open 192.168.1.1. Attackers use them to make a link look like something other than an address. Paste a suspicious link above and the converter shows the address a browser would open. For a suspicious email, the email header analyzer shows where it really came from.
How This Tool Works
| Item | Detail |
|---|---|
| Where it runs | In your browser; nothing is sent to our server. |
| Input checks | Strict: each IPv4 number 0-255 in decimal, IPv6 in any standard form (including ::ffff:192.0.2.1 and zones). Invalid input gets the reason, never a silent guess. |
| Many at once | One value per line, up to 1,000 lines; each line is converted on its own. |
| Shareable link | ?q= followed by a value opens the page with it converted. |
| Links | Hosts are read the way browsers do (WHATWG URL standard), checked against the parser built into Node.js. |
| Stored | Nothing. |
| Last verified | 10 November 2026 |
Frequently Asked Questions
How do I convert an IP address to a decimal number?
How do I convert a decimal number to an IP address?
Why does my database show a negative number for an IP?
Can IPv6 be converted to decimal?
Next steps