Skip to content

IP to Decimal Converter

Convert IPv4 addresses to decimal numbers.

Common IP Addresses

127.0.0.1

Localhost

192.168.1.1

Common router

10.0.0.1

Private network

8.8.8.8

Google DNS

0.0.0.0

Any address

255.255.255.255

Broadcast

Code Examples

function ipToDecimal(ip) {
  return ip.split('.').reduce((acc, octet) =>
    (acc << 8) + parseInt(octet), 0) >>> 0;
}
ipToDecimal("192.168.1.1"); // 3232235777

Frequently Asked Questions

How are IP addresses stored as numbers?

IPv4 addresses are 32-bit numbers. Each octet (0-255) is 8 bits. 192.168.1.1 = (192×2²⁴) + (168×2¹⁶) + (1×2⁸) + 1 = 3232235777.

Why would I convert an IP address to a number?

Databases and network tools often store IPv4 addresses as 32-bit integers because they are compact, easy to index, and simple to compare against ranges (useful for geolocation and firewall rules).

Does this work for IPv6?

IPv6 addresses are 128-bit numbers, far larger than IPv4's 32 bits, so they need big-integer handling. This tool focuses on IPv4; IPv6 conversions produce numbers up to 2¹²⁸-1.

Related Tools

This tool runs entirely in your browser - nothing you enter is uploaded or stored.