IPv4 to Integer Converter — IP to Long & Back Convert IPv4 addresses to 32-bit integers and back.
100% offline
Input11 chars · 1 lines
Output87 chars
Integer · 3232235777
Integer   3232235777
Hex       0xC0A80101
Binary    11000000.10101000.00000001.00000001

About IPv4 to Integer Converter — IP to Long & Back

An IPv4 address like 192.168.1.1 is really just a 32-bit number wearing a dotted-quad costume. Convert it and you get its 32-bit unsigned integer — 3232235777 — the "IP-to-long" form that databases, geo-IP tables, and access-control lists use to store and compare addresses as plain numbers. This tool turns an IPv4 address into that integer (plus hex and binary), and converts any integer in the range 0 … 4294967295 back into an address.

Storing IPs as integers makes range queries and sorting trivial: a BETWEEN on two longs is far cheaper than string math on dotted quads. This free IP to integer converter handles both directions and shows the hex and binary representations alongside, so you can line the bits up with a subnet mask at a glance.

It is pure math and runs entirely in your browser — nothing you enter is uploaded, logged, or sent anywhere.

Features

  • Convert an IPv4 address to its 32-bit unsigned integer (IP-to-long) and back
  • See decimal, hexadecimal (0x…), and per-octet binary forms together
  • Strict validation: octets 0–255 and integers 0 … 4294967295
  • Pure offline math — your input never leaves the device

How to use

  1. Pick a direction: "IP → Integer" or "Integer → IP".
  2. Enter a dotted-quad address (e.g. 192.168.1.1) or a 32-bit integer.
  3. Read the integer, hex, and binary forms in the output pane.
  4. Copy the value you need, or clear and convert another.

Frequently asked questions

How do you convert an IP address to an integer?

Treat the four octets as bytes of a 32-bit number: integer = (a × 2²⁴) + (b × 2¹⁶) + (c × 2⁸) + d. For 192.168.1.1 that is 3232235777. This tool does the bit math for you and also shows the hex and binary forms.

What is the largest IPv4 integer value?

4294967295, which is 2³² − 1 and corresponds to 255.255.255.255. The smallest is 0, for 0.0.0.0. Any integer outside 0 … 4294967295 is not a valid IPv4 address.

Why store IP addresses as integers?

Integers sort and compare faster than strings and make range checks simple — testing whether an address falls inside a block is one numeric BETWEEN. Geo-IP and reputation databases almost always store IPs as longs for this reason.

Is the integer signed or unsigned?

Unsigned. The value is masked to a 32-bit unsigned integer, so addresses from 128.0.0.0 up stay positive (for example 128.0.0.0 is 2147483648, not a negative number).

Does my data get sent anywhere?

No. The conversion is pure JavaScript bit math that runs locally in your browser. Nothing you enter is uploaded or stored.

Everything runs locally in your browser — your input is never uploaded.