IP Address to Integer Converter
Convert an IPv4 address into its 32-bit decimal integer (plus hexadecimal and binary), or turn an integer back into dotted-quad notation.
Direction
Dotted IP: 192.168.1.1
- 1
Octet 1 contribution (×2²⁴)
192 × 16,777,216 = 3,221,225,472 - 2
Octet 2 contribution (×2¹⁶)
168 × 65,536 = 11,010,048 - 3
Octet 3 contribution (×2⁸)
1 × 256 = 256 - 4
Octet 4 contribution (×2⁰)
1 × 1 = 1 - 5
32-bit integer
3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777Each octet scaled by its byte-position weight (256³, 256², 256, 1) then summed.
How does this calculator work?
Multiply each IPv4 octet by its place value (256³, 256², 256, 1) and sum them to get a 32-bit integer from 0 to 4294967295. For example, 192.168.1.1 becomes 3232235777. Reverse it with successive division and modulo by 256 to recover the dotted-quad address.
Formula
How this is calculated
An IPv4 address has four octets (a.b.c.d), each an 8-bit value from 0 to 255. To convert the address to a single 32-bit number, each octet is weighted by its position: the first octet is multiplied by 256³ (16777216), the second by 256² (65536), the third by 256 (256), and the last by 1. Adding these gives an unsigned integer from 0 to 4294967295.
To reverse the process, the integer is decomposed back into octets: a = floor(n / 16777216) mod 256, b = floor(n / 65536) mod 256, c = floor(n / 256) mod 256, and d = n mod 256. The result is reassembled as the familiar dotted-quad string.
The hexadecimal form is the integer written in base 16 (8 hex digits when padded), and the binary form shows each octet as an 8-bit group. The tool validates that every octet stays within 0-255 and that any integer input is a whole number within the unsigned 32-bit range; out-of-range or malformed inputs return no result.
Frequently asked questions
An IPv4 address is 32 bits, so the largest possible value is 2³² − 1 = 4294967295, which corresponds to 255.255.255.255.
Many databases and languages store the value in a 64-bit signed long to keep it positive, since a 32-bit signed integer would overflow past 2147483647. The number itself is still an unsigned 32-bit IPv4 value.
No. IPv6 addresses are 128 bits and use a different hexadecimal notation. This converter handles only 32-bit IPv4 addresses.
Also known as
TG we-Calculate Editorial Team. (2026). IP Address to Integer Converter [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/ip-to-integer-converter
TG we-Calculate Editorial Team. "IP Address to Integer Converter." TG we-Calculate. 2026. https://we-calculate.com/calculator/ip-to-integer-converter.
TG we-Calculate Editorial Team, "IP Address to Integer Converter," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/ip-to-integer-converter
@misc{wecalculate_ip_to_integer_converter, title = {IP Address to Integer Converter}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/ip-to-integer-converter}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
