IP to Number Converter

Convert an IP address to its numeric value and back. Both fields are linked, so editing either one updates the other as you type.

IPv4

An IPv4 address is a 32-bit number written as four 8-bit octets separated by dots, for example 192.168.0.1. Its numeric range runs from 0 to 4,294,967,295.

IPv6

An IPv6 address is a 128-bit number written as eight 16-bit groups in hexadecimal, for example 2001:db8:85a3::8a2e:370:7334. The numeric values are far larger than JavaScript's safe integer range, so they are handled as arbitrary-precision integers.

Why the numeric form matters

An IP address is only a number in disguise. The dotted and colon notations exist for humans; underneath, IPv4 is a single 32-bit integer and IPv6 a single 128-bit integer. Storing addresses as integers is what makes range queries cheap, which is why databases and routing tables work with the numeric form rather than the text form.

For IPv4 the conversion is a × 2563 + b × 2562 + c × 256 + d. So 192.168.0.1 becomes 3,232,235,521.

Other IP tools