Guide
Storing and comparing IPv4 addresses as single integers
An IPv4 address looks like four small numbers, but a computer sees one 32-bit value. Turning the dotted text into that single integer is a routine step when you store addresses in a database, build an allow list that works on ranges, or read a log that wrote the address as a bare number. The page converts a list of addresses, one per line, and shows every spelling of each so you can pick the one your system expects.
The calculation
Think of the four bytes as digits in base 256. The first byte is worth 256³ (16,777,216), the second 256² (65,536), the third 256 and the last 1. Multiply, add and you have the integer. Computers do the same with bit shifts: the first byte is shifted left by 24 places, the second by 16, the third by 8. Because the first byte has the greatest weight, comparing two integers gives the same order as comparing the addresses octet by octet. That is why BETWEEN queries on an integer column can answer “is this address in that range?” with a simple index lookup, something text columns cannot do.
What the page shows
Every address gets its decimal integer in the output box, one per line. A panel under it takes the first valid address and lists it as dotted decimal, 0x hexadecimal, dotted hexadecimal, dotted binary and dotted octal, plus the kind of address: private under RFC 1918, shared carrier-grade NAT space, loopback, link-local, documentation or ordinary public space. The list of results can be copied or downloaded as a text file, one number per line, which suits pasting into a spreadsheet or an import script.
Traps worth knowing
The value is unsigned and runs from 0 to 4,294,967,295. A signed 32-bit database column, such as a plain INT in MySQL or the integer type in PostgreSQL, tops out at 2,147,483,647, so any address above 127.255.255.255 overflows or turns negative. Store the number in an unsigned INT or a 64-bit column instead. Leading zeros are another source of confusion: some libraries read 010 as octal 8, so the page rejects such octets instead of guessing. Whitespace around an address is ignored, and a line that is not an IPv4 address produces a message that quotes the offending text rather than being silently skipped.
A worked example
Enter 192.168.1.1. The sum is 192 × 16,777,216 = 3,221,225,472, plus 168 × 65,536 = 11,010,048, plus 1 × 256 = 256, plus 1, which comes to 3,232,235,777. The hexadecimal form is 0xC0A80101, the dotted binary form is 11000000.10101000.00000001.00000001, and the page marks it as private use under RFC 1918. If a signed column stored it, the value would read back as 3,232,235,777 − 4,294,967,296 = −1,062,731,519, which is the classic symptom of the wrong column type.
Limits
Only IPv4 is supported; an IPv6 address needs 128 bits and does not fit any ordinary integer type, so databases store it as binary or as a dedicated type. The page converts text, it does not look up who owns an address or whether it is in use. If you need to go the other way, the Integer to IPv4 Converter does the reverse.
Related tools
- Integer to IPv4 Converter turns a stored number back into dotted form.
- IP to Hex Converter is the same value written in hexadecimal for packet captures.
- IP Range to CIDR converts a start and end address into subnet blocks.
- Private IP Checker classifies a whole list of addresses.
Checked against the current version of the IPv4 to Integer on .

