Advertisement

IP to Hex Converter

Convert an IP address to hexadecimal (192.168.1.1 = C0A80101) in plain, 0x, dotted and little-endian forms, and convert hex back to an IP address.

IPv4, IPv6, or hex such as C0A80101, 0xC0A80101 or C0.A8.01.01.

IPv4 addresses often turn up in hexadecimal — in packet dumps, in Linux /proc/net/tcp, in C code as 0xC0A80101 and in some obfuscated URLs. This converter writes an address as hex in the common styles (plain, 0x-prefixed, dotted and little-endian) and reads hex back into a normal address. IPv6 addresses are expanded to their full 32 hex digits.

How to use this tool

  1. Enter an IP address, or a hex value such as C0A80101, 0xC0A80101 or C0.A8.01.01.
  2. Tick little-endian if the hex came from x86 memory or /proc/net/tcp, where the bytes are reversed.
  3. Paste several lines to convert a list at once.

Formula

hex = hex(a) ‖ hex(b) ‖ hex(c) ‖ hex(d), each octet written as 2 digits

Each decimal octet from 0 to 255 becomes exactly two hex digits, 00 to FF: the first digit is the octet divided by 16, the second is the remainder. Network byte order is big-endian (first octet first); little-endian simply reverses the four bytes. Leading-zero IPv4 octets are read as decimal. Paired IPv6 brackets are accepted; zone identifiers must be removed explicitly. Digit-only dotted input is decimal; use a full 0x prefix to disambiguate hexadecimal.

Example

For 192.168.1.1: 192 = 12 × 16 + 0 → C0, 168 = 10 × 16 + 8 → A8, and 1 → 01 twice. The result is C0A80101 (0xC0A80101, dotted C0.A8.01.01). In little-endian order the bytes reverse to 0101A8C0 — which is why /proc/net/tcp shows 127.0.0.1 as 0100007F.

Frequently asked questions

Why does /proc/net/tcp show addresses backwards?

The kernel prints the 32-bit address as it sits in memory on little-endian CPUs such as x86, so 127.0.0.1 appears as 0100007F. Tick the little-endian option to read those values; the port after the colon is printed in normal order.

Is the hex form the same number as the decimal form?

Yes. C0A80101 in hex and 3,232,235,777 in decimal are the same 32-bit value written in different bases.

Does upper or lower case matter?

No. Hex digits are case-insensitive, so C0A80101 and c0a80101 are identical. Use the lower-case option if your code style expects it.

What about IPv6?

IPv6 is already written in hex. The tool expands "::" shorthand and gives all 32 digits, the form that reverse-DNS (ip6.arpa) names and many packet tools are built from.

Sources

Last updated: 2026-10-30

Advertisement