Work out ip to hexadecimal instantly with clear inputs, formula shown and shareable results.
An IPv4 address is a single 32-bit unsigned integer that humans read as four decimal octets. Converting each octet to two hex digits gives the form used in IPv4-mapped IPv6 addresses, packet captures and low-level configuration, while the flat decimal value is what databases and geo-IP tables store.
32-bit value
value = o1 * 16777216 + o2 * 65536 + o3 * 256 + o4; each octet renders as two hexadecimal digits
IPv6 transition formats such as ::ffff:c0a8:010a embed the IPv4 address in hex, and some boot-loader and PXE filenames use the hex form of the address.
Range queries and sorting become simple arithmetic, so allow-list and geo-IP lookups can use a single indexed BETWEEN comparison.