Convert an IPv4 address into a 32-bit integer

Network developers use it when an IPv4 address must be stored, compared or exchanged as a 32-bit integer.

Convert an IPv4 address into a 32-bit integer. Everything runs in your browser, so the values you enter are never uploaded, shared, or stored.

How to use

  1. Type the IPv4 address into the input area, using four numbers separated by dots, or paste an integer value as the placeholder suggests.
  2. Decide whether you are going from dotted address to number or the other way round, because the field accepts both forms.
  3. Run the conversion with the main button and read the value shown in the result area beside your entry.
  4. Copy the output into a script, a database column or a network configuration file.
  5. Import a text file instead of typing, then clear the panel before working on the next value.

Example

The sample input holds 192.0.2.1, an address kept for documentation and tests. After converting, feed the number back into the input to check that you get the same dotted address again: that round trip is the quickest way to confirm the result is correct.

Input

192.0.2.1

Output

3221225985

Limits and formats

Where processing happens

The whole conversion happens inside your browser, using the value you type or the file you import. Nothing leaves your device, nothing is kept once the page is closed, and you can therefore work with internal addresses you would rather not send anywhere.

Frequently asked questions

What happens if I enter something that is not a valid IPv4 address?

The tool tells you the input cannot be used instead of returning a number. Fix the value, checking that each of the four parts stays within a single byte, then start the conversion again.

Why store an address as an integer instead of text?

Integers sort, compare and index more easily, and they take a predictable amount of space. APIs and network routines often exchange addresses in that form when they need to order or filter large sets of them quickly.

Can I convert a whole list in one go?

The field is designed around a single value. If you have many addresses, automating the conversion in your own script will save you from pasting them one after another and running the step each time.

Tools in the same category