Skip to content
ZeroServer.tools

Decimal to IP Converter

Convert a 32-bit decimal integer to an IPv4 dotted-quad address, hex, and binary.

IPv4 Address192.168.1.1
Hexadecimal0xC0A80101
Binary (octets)11000000.10101000.00000001.00000001
Decimal (uint32)3232235777

Quick examples

How decimal-to-IP conversion works

Internally, IPv4 addresses are stored as 32-bit unsigned integers. This converter takes a decimal uint32 and converts it to the familiar dotted-quad notation, along with hex and binary representations. The calculation splits the 32-bit value into four 8-bit octets: 3232235777 → 0xC0A80101 → 192.168.1.1.

To go the other way, use the IP to Decimal Converter. For more IP utilities, see the IP Subnet Calculator.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Turning an integer IP stored in a database column back into a readable dotted quad.
  • Reading an IP that a log or an API rendered as a single number.
  • Checking that an integer conversion in your own code produces the address you expect.
  • Converting a stored range boundary back into addresses to sanity-check it.
  • Seeing the hex and binary forms alongside, to check a mask or a subnet boundary.

Frequently Asked Questions

How does the conversion work?
A dotted-quad address is a single 32-bit integer: a.b.c.d equals a×2^24 + b×2^16 + c×2^8 + d. So 3232235777 is 192.168.1.1 — the dots are purely a human convenience over one number.
Why would an IP be stored as an integer?
Because it is compact, fast to index, and makes range queries trivial — checking whether an address falls in a subnet becomes a simple integer BETWEEN. That is why geolocation and firewall databases store them this way.
Which datatype should hold it?
An UNSIGNED 32-bit integer, or a 64-bit signed one. A signed 32-bit column overflows above 127.255.255.255 and stores negative values for half the address space — a real and common bug.
Does this work for IPv6?
The same idea, but the number is 128 bits, which exceeds every native integer type. IPv6 needs two 64-bit halves, a decimal string, or a dedicated type such as Postgres INET.
Why do some short forms still resolve?
Because inet_aton accepts partial forms — 127.1 expands to 127.0.0.1, and a bare integer is accepted directly. Browsers historically honoured this, which made it a classic obfuscation and SSRF-filter bypass.
Why does the integer form need to be unsigned?
Because addresses above 127.255.255.255 set the high bit, which a signed 32-bit type reads as negative. Storing them in a signed column is why some addresses come back as negative numbers and fail to convert.
What is this used for in practice?
Range queries. Comparing integers makes `BETWEEN` work for a subnet, which is far faster than string matching — the reason geolocation databases store address ranges as integer pairs.

Common errors and gotchas

  • Getting the byte order wrong, which produces a valid-looking address with the octets reversed.
  • Treating the integer as signed, so addresses above 127.255.255.255 come out negative or wrap.
  • Assuming the value is IPv4 when it is a truncated or packed IPv6 representation.
  • Feeding in a value beyond the 32-bit range and getting a silently truncated result.
  • Confusing an integer IP with an integer subnet mask, which look identical and mean different things.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate