Long to IP Converter

Converts a 32-bit unsigned integer ('long') back into its dotted-quad IPv4 address, the reverse of the integer form databases and firewall rules often use to store IP addresses. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-25

Overview

Introduction

Systems that store IP addresses as a plain integer, for compact storage or fast range comparisons, need a way to turn that number back into a readable address.

This tool does that conversion entirely in your browser, so nothing you paste is sent to a server.

What Is Long to IP Converter?

A converter that treats an unsigned 32-bit integer as an IPv4 address and reconstructs its familiar dotted-quad form.

It's part of this site's Network Tools collection and runs entirely client-side, and it's the exact inverse of the IP to Long Converter.

How Long to IP Converter Works

The integer is broken into four bytes using integer division and modulo by powers of 256: dividing by 16777216 and taking the result mod 256 gives the first octet, and so on down to the plain remainder for the last octet.

Each recovered byte is guaranteed to be between 0 and 255, so the output is always a well-formed dotted-quad address for any valid 32-bit input.

When To Use Long to IP Converter

Use it when a database, log file, or API returns an IP address as a raw integer and you need to read it as a normal address.

It's also useful for spot-checking the boundaries of a numeric IP range, like confirming what address a given upper or lower bound actually represents.

Often used alongside IP to Long Converter.

Features

Advantages

  • Exact, deterministic conversion for the entire valid 32-bit range.
  • Strictly validates the input, rejecting negative numbers, decimals, and anything above 4294967295.

Limitations

  • IPv4 only — a 128-bit IPv6 address can't be represented as a single 32-bit integer.
  • Doesn't indicate whether the resulting address is public, private, or reserved.

Examples

Converting an integer back to a documentation address

Input

3221225985

Output

192.0.2.1

3221225985 ÷ 16777216 = 192 remainder 2130433, which further decomposes to octets 0, 2, and 1.

Converting the maximum 32-bit value

Input

4294967295

Output

255.255.255.255

4294967295 is 2³²−1, the largest unsigned 32-bit integer, which maps to the broadcast address.

Best Practices & Notes

Best Practices

  • Use the IP to Long Converter to check the round trip when debugging a stored value.
  • Reject or flag values above 4294967295 upstream; they can't represent a valid IPv4 address.
  • Confirm which byte order a shared integer value assumes (network byte order is standard) before decoding it in a different system.

Developer Notes

The implementation uses Math.floor and the modulo operator on plain numbers rather than bitwise operators, since JavaScript's bitwise operators coerce to signed 32-bit integers and would misbehave for addresses at or above 128.0.0.0.

Long to IP Converter Use Cases

  • Reading an IP address back out of a database column stored as an integer
  • Converting a numeric bound from a firewall rule or geolocation table into a readable address
  • Verifying the round trip after converting an address to its integer form

Common Mistakes

  • Entering a signed integer that's actually negative after 32-bit overflow in another system, instead of its unsigned equivalent.
  • Assuming this works for IPv6 integers, which require 128 bits rather than 32.

Tips

  • Pair this with the IP to Long Converter to confirm a round trip when verifying stored data.

References

Frequently Asked Questions