Outils gratuits

Convertisseur IPv4 en entier

Convertir une adresse IPv4 en ses représentations décimale, hexadécimale et binaire.

What the IPv4 to Integer Converter does

This tool converts an IPv4 address back and forth between its human-readable dotted form and the plain numbers a computer actually stores: a decimal integer, a hexadecimal integer, and a 32-bit binary string. Type 192.168.1.1 and you get 3232235777 in decimal, 0xC0A80101 in hex, and 11000000.10101000.00000001.00000001 in binary; type any of those numeric forms and it hands you the dotted address back. It works in both directions automatically — it detects a dot to read an address, a 0x prefix to read hex, and bare digits to read a decimal integer — so you never have to tell it which way you are going. You reach for this whenever an address needs to live somewhere that is not a dotted string: a database column, a spreadsheet, a log line, a range comparison, or a bit of code that packs addresses into fixed-width fields.

How it works technically

An IPv4 address is four octets, each one byte (8 bits), for a total of 32 bits. To turn a.b.c.d into a single number the tool computes a×16777216 + b×65536 + c×256 + d, which is the same as shifting each octet into its position: a«24 | b«16 | c«8 | d. That yields an unsigned value somewhere between 0 (0.0.0.0) and 4294967295 (255.255.255.255) — the full 32-bit range. Going the other way, it peels the octets back out with masks and shifts: (n»24)&255, (n»16)&255, and so on. The hexadecimal form is just that same integer in base 16 (two hex digits per octet, which is why 192 becomes C0), and the binary form groups the 32 bits into four bytes so you can literally see the network and host bits. The tool validates as it goes: octets above 255 are rejected, and any integer past 4,294,967,295 is flagged as out of the 32-bit range rather than silently wrapping.

Concrete examples and use cases

  • Storing IPs efficiently — a 4-byte INT UNSIGNED column is smaller and faster to index than a text field, and range queries like ip BETWEEN x AND y just work.
  • GeoIP and blocklists — most IP-to-country and reputation datasets are published as integer start/end ranges; converting an address lets you find which range contains it.
  • Sorting — sorting addresses as strings puts 10.0.0.9 after 10.0.0.100; sorting the integers gives correct numeric order.
  • Debugging — when a packet capture or a C struct shows a raw 0xC0A80101, this tells you it is 192.168.1.1 at a glance.

Practical tips and gotchas

Keep the value unsigned. Some languages treat a 32-bit integer as signed, so addresses above 127.255.255.255 (where the top bit is set) can appear as a negative number; if your database or code shows a negative value, add 4,294,967,296 to recover the real address. Watch out for leading zeros too: writing an octet as 010 is interpreted as octal (8) by some parsers, so always use plain decimal octets. Finally, remember this is IPv4 only — a 128-bit IPv6 address will not fit in a 32-bit integer, and for those you want a dedicated IPv6 tool instead.

Privacy: the conversion happens entirely in your browser with client-side JavaScript. Whatever address or integer you enter never leaves your device — there is no server call, no upload and no logging — so you can convert internal or customer addresses without exposing them. If you would like to see how your own public address looks to the outside world, our IP check shows it along with geolocation and reverse-DNS details.

Les gens ont trouvé cette page en recherchant

Vraies phrases de recherche auxquelles cette page répond — les liens ouvrent la page qui les couvre en profondeur.