You don't have javascript enabled. Please enable javascript to use this website.

IP to Decimal Converter

Convert any IPv4 or IPv6 address to its decimal integer value — single address or bulk list mode, processed entirely in your browser.
IP Address:
Convert Now Clear
More Tools

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.

1

Enter an IP Address

Type or paste a single IPv4 or IPv6 address into the input field — for example, 192.168.1.1 or 2001:db8::1.
2

Switch to Bulk Mode (Optional)

Click Bulk Mode to enter multiple IP addresses, one per line, for simultaneous conversion of an entire list.
3

Click Convert to Decimal

The converter calculates the decimal integer for each address immediately, directly in your browser with no server request.
4

Read the Result

IPv4 addresses display a 32-bit integer (0 to 4,294,967,295); IPv6 addresses display a 128-bit integer of up to 39 digits.
5

Copy or Export the Output

Copy a single result with one click, or download the full bulk output as a plain-text file for use in scripts or databases.

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).

Diagram: 192.0.2.1 as 192 × 16,777,216 + 0 × 65,536 + 2 × 256 + 1 = 3,221,225,985
Each part is worth 256 times the next one, so an IPv4 address is one number in base 256.

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.00Minimum IPv4 value
8.8.8.8134,744,072Google Public DNS (AS15169)
1.1.1.116,843,009Cloudflare DNS (AS13335)
192.168.1.13,232,235,777Default gateway (RFC 1918)
10.0.0.0167,772,160RFC 1918 private range start
255.255.255.2554,294,967,295Maximum 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.


Frequently Asked Questions

What is the difference between IP to decimal and IP to integer?
The terms are interchangeable. "Decimal" emphasizes the base-10 numeric output; "integer" emphasizes the data type used to store or process it. Both refer to the same operation: expressing a 32-bit IPv4 or 128-bit IPv6 address as a single unsigned whole number. Programming contexts (Java, Python, SQL) tend to use "integer" or "long"; network tools tend to use "decimal."
How accurate is the IP to decimal conversion?
The conversion is deterministic and lossless — every valid IP address maps to exactly one decimal value and back, with no rounding or approximation. IPv4 results are always in the range 0 to 4,294,967,295. IPv6 results are exact 128-bit integers. If the tool returns an error, the input address is invalid; no conversion is attempted on malformed entries.
Why would I store an IP address as a decimal integer in a database?
Integer storage is faster to index, sort, and range-query than string storage. MySQL's INET_ATON() function performs this conversion natively — storing as INT UNSIGNED reduces row size from up to 15 bytes (VARCHAR) to 4 bytes for IPv4. Range containment checks become simple numeric comparisons: decimal(IP) BETWEEN decimal(range_start) AND decimal(range_end), with no string parsing overhead.
Can I convert IPv6 addresses to decimal?
Yes. IPv6 addresses (RFC 4291) are 128-bit numbers. The decimal equivalent can reach 340,282,366,920,938,463,463,374,607,431,768,211,455. Databases store these as DECIMAL(39,0) or as two BIGINT columns, since the value exceeds the 64-bit limit of a standard integer type. The converter handles both compressed (::1) and full (2001:0db8:0000:...) IPv6 notation.
Do you store the IP addresses I convert?
No. All conversion runs entirely in your browser using JavaScript. No address data is sent to any server, logged in any database, or stored in any form. Closing the page clears all input and output immediately.
Why does my IPv6 decimal result look different from another converter?
Some tools expand compressed IPv6 notation before converting; others convert the compressed form directly. The correct method is always to expand the full 128-bit address first, then convert — producing a consistent integer regardless of how the input was written. If results differ between tools, verify the other tool is handling :: expansion correctly per RFC 4291 §2.2.

Related Guides

Guide What Is IPv4?
Understand the 32-bit address space that maps to decimal integers between 0 and 4,294,967,295, and why the 32-bit limit defines the IPv4 exhaustion problem.
Guide What Is IPv6?
Learn how 128-bit IPv6 addresses produce decimal integers up to 340 undecillion, and why standard 64-bit integer types cannot store them without special handling.