1. Home
  2. Developer tools
  3. Integer to IPv4

Integer to IPv4

Logs and databases often hold an address as a number such as 3232235777. Paste the numbers and read the familiar four-part addresses.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Integer to IPv4

  1. Paste integers, one per line.
  2. Read the dotted address for each.
  3. Copy the list or check the other forms.

Features

  • Converts lists
  • Exact for the full 0 to 4,294,967,295 range
  • Clear error above 32 bits
  • Shows hex, binary and octal forms too
  • Names the kind of address
  • Copy or download the result

Supported formats

Input

  • Typed or pasted numbers

You get

  • Dotted IPv4 address
  • Hex and binary forms

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Integer to IPv4 is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Values must be between 0 and 4294967295.
  • The number is read as unsigned; a negative signed value must be converted first.

Guide

Turning a stored number back into a dotted IPv4 address

Sometimes an address arrives as a bare number: a column in a database dump, a field in a flow record, a value in a configuration file written by a script. The page turns each integer back into the four-part form people can read, and shows the other notations alongside so you can check it against whatever tool produced the number.

How the conversion works

An IPv4 address is a 32-bit number cut into four bytes. To recover them, divide by 256³ for the first byte and keep the remainder, divide that by 256² for the second, and so on. The quotients are the four numbers of the dotted address. In code the same job is done with shifts and masks: shift right by 24 and mask with 255 for the first byte, by 16 for the second, by 8 for the third, and mask the number itself for the last. The page accepts decimal integers only, one per line, and lines can have spaces around them.

Range and special values

The valid range is 0 to 4,294,967,295, which is 2³² − 1. Anything outside is reported, not wrapped around. A few values are worth recognising on sight. 2130706433 is 127.0.0.1, the loopback address (127 × 16,777,216 + 1). 167772161 is 10.0.0.1, the first address of the 10.0.0.0/8 private block. 3232235777 is 192.168.1.1. The detail panel under the output takes the first valid number and adds the kind of address, so a number that lands in 169.254.0.0/16 is flagged as link-local and a loopback value as loopback.

Byte order and signedness

Two mistakes produce wrong-looking addresses. The first is a signed column: if the source stored the value in a signed 32-bit integer, anything above 2,147,483,647 appears negative. Add 4,294,967,296 before converting. The second is byte order. Network protocols and this page put the most significant byte first. Some programs on little-endian machines print the integer with the bytes reversed, so 1.1.168.192 appears instead of 192.168.1.1. If the result looks like a mirror image of what you expected, convert the number to hexadecimal, reverse the pairs of digits, and convert back with the Hex to IP Converter.

A worked example

Enter 3232235777. Dividing by 16,777,216 gives 192 with a remainder of 11,010,305. That divided by 65,536 gives 168 with 257 left. Dividing 257 by 256 gives 1 remainder 1. The address is therefore 192.168.1.1. The detail table confirms the same value as 0xC0A80101, C0.A8.01.01, 11000000.10101000.00000001.00000001 and 0300.0250.01.01, and labels it private use under RFC 1918.

Limits

The tool converts numbers to IPv4 only; IPv6 addresses are 128 bits and do not fit in a common integer type. Numbers with decimals, exponents or thousands separators are rejected so that a typo cannot turn into a plausible-looking address. The result is arithmetic, not a lookup: it cannot tell you who owns the address or whether anything answers there.

Checked against the current version of the Integer to IPv4 on .

Frequently asked questions

What does a number like 0 or 4294967295 turn into?

Zero is 0.0.0.0, the unspecified address, and 4294967295 is 255.255.255.255, the limited broadcast address. They are the two ends of the whole IPv4 space.

My database holds a negative number for an address. How do I convert it?

Add 4,294,967,296 to the negative value first. For example −1,062,731,519 becomes 3,232,235,777, which this page converts to 192.168.1.1.

What address is 2130706433?

127.0.0.1, the loopback address. 127 × 16,777,216 + 1 = 2,130,706,433.

Why is a negative number rejected?

Some languages store addresses as signed 32-bit integers, which makes the high addresses negative. Add 4,294,967,296 to a negative value to get the unsigned number, then convert it.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.