IP to Decimal Converter |
IP to Decimal Converter — What It Returns and How It Works
IP to decimal conversion (also called IP to integer) translates an IPv4 or IPv6 address into its base-10 numeric equivalent. For IPv4 (RFC 791), each dotted-decimal address is a 32-bit number — 192.168.1.1 becomes 3,232,235,777. IPv6 addresses (RFC 4291) are 128-bit numbers, producing integers with up to 39 digits. Decimal representation is used for database storage, geolocation lookups, IP range arithmetic, and firewall rule comparisons. Bulk mode converts multiple addresses simultaneously — one IP per line.
| Format | Example (IPv4) | Decimal Value | Primary Use |
|---|---|---|---|
| Dotted-decimal | 192.168.1.1 | — | Human-readable notation |
| Hexadecimal | c0.a8.01.01 | — | Low-level debugging, packet inspection |
| Binary | 11000000.10101000.00000001.00000001 | — | Subnet mask operations, CIDR math |
| Decimal (integer) | 192.168.1.1 | 3,232,235,777 | Database storage, range queries, ACLs |
IP to Decimal Converter — How to Use
IP to Decimal Converter converts any IPv4 or IPv6 address to its decimal integer value, instantly in the browser.Get the decimal integer for any IP address in seconds — single address or bulk list mode.
Switch to Bulk Mode (Optional)
Click Convert to Decimal
Read the Result
Copy or Export the Output
Technical Details — IPv4 and IPv6 Decimal Conversion
IPv4 conversion formula (RFC 791). An IPv4 address is a 32-bit unsigned integer expressed in dotted-decimal notation. The decimal value equals (octet₁ × 256³) + (octet₂ × 256²) + (octet₃ × 256) + octet₄. For 192.168.1.1: (192 × 16,777,216) + (168 × 65,536) + (1 × 256) + 1 = 3,232,235,777. The full range is 0 (0.0.0.0) to 4,294,967,295 (255.255.255.255).
IPv6 conversion (RFC 4291 §2.3). An IPv6 address is a 128-bit unsigned integer. The decimal value is derived by treating the 16-byte address as a big-endian binary number. The compressed address 2001:db8::1 expands to 0x20010db8000000000000000000000001, which equals 42,540,488,661,975,842,760,550,356,425,300,246,529 in decimal. The maximum IPv6 decimal value is 340,282,366,920,938,463,463,374,607,431,768,211,455 (equivalent to 2128 − 1).
Database storage patterns. MySQL stores IPv4 decimals natively via
INET_ATON() / INET_NTOA() as INT UNSIGNED (4 bytes vs. up to 15 bytes for VARCHAR).
Java uses java.net.InetAddress.getAddress() with BigInteger for IPv6.
Python: int.from_bytes(socket.inet_aton(ip), 'big') for IPv4,
int(ipaddress.ip_address(ip)) for both.
IP range containment checks reduce to: decimal(IP) BETWEEN decimal(start) AND decimal(end) —
a single indexed numeric comparison with no string parsing.
Bulk conversion. Bulk mode accepts one IP address per line — mix of IPv4 and IPv6 is supported in a single pass. Each address is validated before conversion; invalid entries are skipped with an inline error, leaving valid results intact. All processing runs in the browser with no server round-trip.
Common IPv4 Reference Decimals
| IPv4 Address | Decimal Value | Note |
|---|---|---|
| 0.0.0.0 | 0 | Minimum IPv4 value |
| 8.8.8.8 | 134,744,072 | Google Public DNS (AS15169) |
| 1.1.1.1 | 16,843,009 | Cloudflare DNS (AS13335) |
| 192.168.1.1 | 3,232,235,777 | Default gateway (RFC 1918) |
| 10.0.0.0 | 167,772,160 | RFC 1918 private range start |
| 255.255.255.255 | 4,294,967,295 | Maximum IPv4 value (2³² − 1) |
Use Cases
Database migration to integer storage. A backend developer is migrating an IP log table from VARCHAR(45) to INT UNSIGNED for IPv4 entries. Bulk mode converts the full export — thousands of addresses at once — so the developer can verify INET_ATON() output against the tool before deploying the schema migration.
Firewall ACL with numeric ranges. A network engineer building access control rules for a legacy firewall appliance must represent 10.0.0.0–10.0.0.255 as a decimal range. Bulk mode converts both boundary addresses in a single pass: 10.0.0.0 → 167,772,160 and 10.0.0.255 → 167,772,287.
Geolocation database debugging. A geolocation service stores IP ranges as decimal integers for fast prefix-length queries. When a lookup returns an unexpected result, the developer converts the problem IP to decimal to match the stored format and compare directly against the database range table without string conversion overhead.