Skip to content

IP to Decimal

Convert an IPv4 address to a decimal number.

Input
Output

No result

About IP to Decimal

IP to Decimal converts a dotted-quad IPv4 address into the single unsigned 32-bit integer it represents. Each of the four octets is a byte of that number, so an address such as 192.168.1.1 becomes the decimal value that network equipment, access-control tables and some analytics stores keep in their internal form.

That conversion is the reason the tool exists: comparing an address range numerically is far faster than comparing four separate fields, and a great many firewalls, CDN configuration panels and log schemas store addresses that way. Knowing the decimal form makes it possible to sanity-check what a rule actually covers instead of trusting the summary a dashboard gives you.

The parser expects exactly four dot-separated parts and does not range-check them, so it is worth feeding it a well-formed address. Abbreviated forms and addresses containing a port or a zone suffix are not accepted, and IPv6 has no equivalent single-integer representation and is out of scope. A malformed input produces an explicit error rather than a meaningless number.

How to use IP to Decimal

  1. 1 Enter the address as four decimal octets separated by dots.
  2. 2 Convert it to see the unsigned 32-bit decimal equivalent.
  3. 3 Use the number for range comparisons or for matching a log format that stores addresses that way.

Frequently asked questions

Why would I want the decimal form of an address?

Because range checks and lookups on a single integer are simpler and faster than on four fields, which is why firewall rules, geolocation databases and many log schemas store addresses numerically. Converting by hand is error-prone; the arithmetic is exact here.

Can I enter an abbreviated address such as 10.1?

No. All four octets must be present. Compressed forms are accepted by some operating systems at the command line, but they are ambiguous as data and are not part of the conversion, so expand the address first.

Does it work with IPv6?

No, because IPv6 addresses are 128 bits and cannot be collapsed into a single number that a typical database integer column or a spreadsheet can hold. IPv6 range logic needs a different approach entirely.

What happens if an octet is above 255?

It is not rejected. The conversion assumes a well-formed address, so a value out of range passes into the arithmetic and produces a number that does not correspond to a real address. Validate the address before using it for anything that matters.

Free, online, and private

Free to use

IP to Decimal is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How IP to Decimal behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Accepted form four dot-separated parts — any other part count produces the line "Invalid IP"
Conversion parts are shifted into a 32-bit word with << 24 | << 16 | << 8, then made unsigned with >>> 0
Output one unsigned decimal integer — 192.168.1.1 becomes 3232235777
Part coercion each part is passed through Number(), which accepts exponents, hex literals and an empty string
Direction IPv4 to decimal only; the reverse direction lives in the separate Decimal to IP tool

Compiled from the implementation of this tool and checked against it by itoolnet.

What IP to Decimal does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • Parts are never range-checked, so an octet above 255 is shifted into the neighbouring byte rather than rejected: 192.168.1.256 returns 3232235776, the same number as 192.168.1.0, with no sign that the address was impossible.
  • Because Number() does the coercion, an empty part counts as zero — 192.168.1. comes back as 3232235776 — and forms such as 0x10.0.0.1 are read as hexadecimal instead of being turned away as malformed.
  • IPv6 has no path through this code at all: a colon-separated address contains no dots, so it fails the four-part test and the tool answers with its generic "Invalid IP" line rather than converting anything.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to IP to Decimal with the snippet below. It is free, runs entirely in your browser, and needs no signup.