IPv4 to Hex Converter

Enter an IPv4 address to convert to hexadecimal.

How it is calculated

The address must be four numbers from 0 to 255 separated by dots. The tool combines them into one 32-bit integer: value = o1 × 256³ + o2 × 256² + o3 × 256 + o4, where o1 to o4 are the four octets. That integer is printed in two ways: as a decimal number from 0 to 4,294,967,295, and as hexadecimal padded to eight digits in capitals with a 0x prefix, so each octet is exactly two hex digits side by side with no dots. Anything else gives no result: fewer or more than four parts, an octet above 255, letters, or an IPv6 address. Leading zeros are read as ordinary decimal, so 010 is 10, not octal 8.

Worked example

Convert 192.168.1.1. Each octet in hex: 192 = C0, 168 = A8, 1 = 01, 1 = 01. Joined together they give 0xC0A80101. As a single number: 192 × 16,777,216 + 168 × 65,536 + 1 × 256 + 1 = 3,221,225,472 + 11,010,048 + 256 + 1 = 3232235777. The decimal form is shown without thousands separators. The highest address, 255.255.255.255, becomes 0xFFFFFFFF.

Try this example →

Common mistakes

  • Expecting dots in the hex result; the tool returns one contiguous value (0xC0A80101), not C0.A8.01.01, so split it into pairs yourself if you need per-octet form.
  • Entering an address with leading zeros, such as 010.001.001.001, and assuming it is octal; here every octet is read as decimal.
  • Pasting a CIDR address like 192.168.1.1/24 or one with a port; only a bare four-part address is accepted.
  • Confusing the decimal result with a dotted number: 3232235777 is the whole address as one integer, not a different IP.
  • Treating the byte order as little-endian; the result is network (big-endian) order, with the first octet as the most significant byte, which may differ from how a CPU stores it in memory.

About this calculator

An IPv4 address is really a single 32-bit number, split for human readability into four 8-bit octets written in dotted-decimal form (each 0–255). Converting to hexadecimal means writing each octet as a 2-digit hex value (00–FF) — so 192.168.1.1 gives C0, A8, 01 and 01, which this tool joins into one contiguous 32-bit value, 0xC0A80101 (no dots), and also shows as the decimal integer 3232235777.

Network engineers and systems programmers run into hex-formatted IPv4 addresses in router and firewall configuration files, subnet mask arithmetic, packet captures in tools like Wireshark, and low-level socket or embedded-networking code where addresses are handled as raw 32-bit integers rather than strings. It's also a common step in CTF and networking-certification exercises that test binary/hex fluency.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Because every octet becomes exactly two hex digits, the output can be read in pieces: 192.168.1.1 is C0 A8 01 01, so 0xC0A80101, and the same address is 3232235777 as one decimal number. That makes it easy to spot a network prefix in a packet capture or a config field that stores addresses as integers. Which would you like supported next, IPv6 or subnet masks?

Popular calculators

All Calculators