Advertisements

headerup to 320x100 / 728x90

IP to Decimal Converter

Convert an IPv4 address into its 32-bit unsigned decimal form for routing tables, allow-lists, and database storage.

Quick Converter

Use a compact field for small conversion and calculation tools.

Input
Focused controls for small conversions and calculations.
Results
Readable cards for unit-heavy output, with raw output kept for special cases.
Enter a value above or tap a sample to see structured results.
Advertisements

content bottomup to 300x250

What is IP to Decimal Converter

Last reviewed:

Decimal (base 10) is the everyday number system humans use, handy as a reference format when converting between binary, octal, and hexadecimal values.

IP to Decimal Converter takes a dotted-quad IPv4 address and returns the single 32-bit unsigned integer that represents it, combining all four octets using the formula a*2^24 + b*2^16 + c*2^8 + d.

Decimal IPs are widely used in MySQL, PostgreSQL, Redis, and geo-IP databases because a single INTEGER column is faster to index and compare than a VARCHAR of dotted-quad text.

Why use it

  • Store IPs compactly as a single INTEGER column for fast range queries.
  • Sort and compare IP addresses numerically instead of lexically.
  • Match allow-list or deny-list rules described by integer ranges.
  • Cross-check geo-IP database lookups that use integer ranges.
  • Debug firewall, proxy, or VPC rules that log IPs as integers.

Features

  • Deterministic 32-bit unsigned decimal output
  • Matches MySQL INET_ATON and Python ipaddress
  • Instant client-side conversion
  • Validates IPv4 octets before converting
  • Copy-ready integer output

How to use IP to Decimal Converter

  1. Paste an IPv4 address. Enter a dotted-quad IPv4 address such as 192.168.0.1 in the input panel.
  2. Read the decimal value. The 32-bit unsigned decimal integer is shown in the output immediately.
  3. Copy it into your query. Copy the integer into your INET_ATON, Redis key, or firewall rule.

Example (before/after)

Dotted-quad IPv4

192.168.0.1

32-bit decimal

3232235521

Common errors

Octet out of range

Each IPv4 octet must be between 0 and 255.

Fix: Check the offending octet highlighted in the error message and correct it.

Pasting CIDR notation

A CIDR string like 10.0.0.0/24 is not a single address.

Fix: Remove the /prefix before converting, or use a CIDR calculator instead.

Using IPv6

IPv6 addresses do not fit into 32 bits.

Fix: Use a dedicated IPv6-to-decimal tool for 128-bit addresses.

FAQ

What decimal range is valid?

0 to 4,294,967,295 (2^32 - 1).

Does it match MySQL INET_ATON?

Yes. The output equals `SELECT INET_ATON('192.168.0.1')`.

Is it the same in PostgreSQL?

PostgreSQL's `inet` type stores the same conceptually; use `::integer` casts with caution because `inet` allows CIDR too.

Does this support IPv6?

No. Use the IPv6 converter for 128-bit addresses.

Is my input sent to a server?

No. The conversion happens entirely in the browser.

Why convert to decimal?

Integer comparisons and range queries are faster and easier to index than dotted-quad strings.