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
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.