Convert any IPv4 address to its 32-bit decimal integer — with every step of the math shown, so you see exactly how the number is built. Free, instant, and everything runs in your browser.
Convert an IPv4 address
Worked examples
Click any row to load it into the converter above.
IPv4 address
Calculation
Decimal
192.168.1.1
(192 x 16,777,216) + (168 x 65,536) + (1 x 256) + (1 x 1) = 3,232,235,777
3,232,235,777
255.255.255.255
(255 x 16,777,216) + (255 x 65,536) + (255 x 256) + (255 x 1) = 4,294,967,295
4,294,967,295
0.0.0.0
(0 x 16,777,216) + (0 x 65,536) + (0 x 256) + (0 x 1) = 0
0
127.0.0.1
(127 x 16,777,216) + (0 x 65,536) + (0 x 256) + (1 x 1) = 2,130,706,433
2,130,706,433
8.8.8.8
(8 x 16,777,216) + (8 x 65,536) + (8 x 256) + (8 x 1) = 134,744,072
134,744,072
10.0.0.1
(10 x 16,777,216) + (0 x 65,536) + (0 x 256) + (1 x 1) = 167,772,161
167,772,161
Batch mode
Paste one IPv4 address per line. Invalid lines are flagged individually without stopping the rest.
How the conversion works
An IPv4 address is four octets — four 8-bit numbers written in dotted-decimal notation. Together they form one 32-bit unsigned integer, which means every IPv4 address is also a single number between 0 and 4,294,967,295. Each octet acts as one digit in a base-256 number system, so the decimal value is:
The weights 16,777,216 / 65,536 / 256 / 1 are 256³, 256², 256¹ and 256⁰ — each octet holds exactly 8 bits, and 2⁸ = 256. That is why this tool multiplies the first octet by 16,777,216, the second by 65,536, and so on, then adds the four products.
Frequently asked questions
An IPv4 address is really a 32-bit unsigned integer. The dotted-decimal form you type every day (like 192.168.1.1) is just human-friendly notation: each of the four octets is one byte (8 bits) of that integer, i.e. one digit in a base-256 number system. Converting to decimal simply evaluates those four base-256 digits into the single integer computers actually store and compare.
Multiply each octet by a power of 256 based on its position, then add: decimal = (octet1 x 16777216) + (octet2 x 65536) + (octet3 x 256) + octet4. Those weights are 256^3, 256^2, 256^1 and 256^0. For 192.168.1.1: (192 x 16777216) + (168 x 65536) + (1 x 256) + 1 = 3221225472 + 11010048 + 256 + 1 = 3232235777. This tool shows that exact breakdown for every conversion.
Databases store IPs as integers for speed: MySQL has INET_ATON() / INET_NTOA() and an INT UNSIGNED column holds any IPv4 in 4 bytes versus up to 15 bytes as text. IP range checks become a single fast numeric comparison (decimal BETWEEN start AND end) instead of string parsing. Firewall rules and ACLs, geolocation databases, log analysis pipelines and socket APIs (the C inet_addr() function) all work with the integer form.
The smallest is 0.0.0.0 = 0 and the largest is 255.255.255.255 = 4294967295, which is 2^32 - 1. Every IPv4 address maps to exactly one integer in that range, and every integer in that range maps back to exactly one IPv4 address.
This tool outputs the familiar base-10 (decimal) integer that databases, firewalls and APIs expect. An IP-to-octal converter instead rewrites each octet in base-8 — a legacy Unix notation where 192.168.1.1 becomes 300.250.1.1. Same address, different number base; pick decimal for anything modern.
No. This tool always reads octets as decimal digits, so 010.001.001.001 is treated as 10.1.1.1 = 167837953. Note that very old C library functions (inet_addr) historically interpreted leading zeros as octal, which caused real bugs — that quirk does not apply here.
No. The conversion runs entirely in your browser with JavaScript: nothing is uploaded, logged or stored anywhere. You can safely convert addresses copied from private configs or firewall rules.
We use cookies and third-party services (including Google AdSense) to personalize content, analyze traffic, and serve relevant ads. By clicking "Accept", you consent to our use of cookies as described in our Privacy Policy.
Report an issue
2 taps, no typing needed — diagnostics are sent automatically.