Конвертация IP-адреса в число и обратно
Tool guide
An IPv4 address is just a 32-bit integer wearing a friendly costume. Databases store it as an unsigned INT, packet dumps print it as 0xC0A80101, and subnet math is easier in binary, so the same host shows up in four different shapes depending on where you look. Paste any one of them here and the tool prints the other three, entirely in your browser — the address is never sent anywhere. Handy when a log line or a CSV export hands you a bare number and you need the host it belongs to. See also: convert a number between binary, hex and decimal, build a pattern that matches addresses in a log, decode hex values from a dump.
Multiply each octet by its weight — 16777216, 65536, 256 and 1 — then add the four products. For 192.168.1.1 that is 192×16777216 + 168×65536 + 1×256 + 1 = 3232235777. The tool runs exactly that arithmetic, which mostly saves you from slipping a place value when the octets are large.
Four bytes instead of fifteen characters, a single-instruction comparison, and subnet range queries with a plain BETWEEN rather than a string LIKE. MySQL has INET_ATON and INT UNSIGNED for this; PostgreSQL has the inet type. The cost is that any export or dashboard then shows a bare number that somebody has to decode.
No — it is IPv4 only, four octets and the matching 32-bit integer. IPv6 is 128 bits written as eight hexadecimal groups with zero compression via a double colon, which needs a different parser entirely. Pasting something like 2001:db8::1 will not produce a meaningful result.
Subnet boundaries. A /24 mask means the first 24 bits identify the network and the last 8 identify the host, and on 11000000.10101000.00000001.00000001 you can point at that boundary directly. It is the fastest way to show a colleague why two addresses do or do not sit in the same segment.
It is not. The arithmetic runs in a script on the page, so the value stays inside your browser tab and never reaches our logs. Close the page and the input goes with it, which makes internal corporate ranges safe to paste.
On a phone, yes — the single input and the two buttons fit a narrow screen. Fully offline, no: the page itself has to load once over the network. After that load, each conversion is computed locally and needs no further connection.
You will not get an implausible answer any more: an address with an octet above 255 such as 192.168.1.300, and any number from 4294967296 upward, is rejected with a message rather than quietly converted. When that message appears, look for a stray character — a trailing space, a full stop after the last octet, or a missing 0x prefix, without which 08080808 is read as a decimal number. Clean it up and convert again.
Before: 3232235777
After: 192.168.1.1 · 0xC0A80101 · 11000000.10101000.00000001.00000001
Before: 8.8.8.8
After: 134744072 · 0x08080808 · 00001000.00001000.00001000.00001000
Before: 0x7F000001
After: 127.0.0.1 · 2130706433 · 01111111.00000000.00000000.00000001
Your rating and feedback help decide what to improve next.