NetCalcLab

Hex to IP Converter

Convert an eight-digit hexadecimal value into a dotted-decimal IPv4 address. The 0x prefix is optional, and separators such as dots, colons or spaces are ignored.

Eight hex digits (32 bits). A leading 0x is optional.

Examples:

Working through a hex address by hand

A hex IPv4 address is four bytes written as eight hex digits. Each pair of digits is one octet, so the conversion is four independent two-digit base-16 to base-10 conversions. The byte order is the same as the dotted notation, so no reversing is needed.

C0A80101 to dotted decimal
C0 -> C = 12, so 12 × 16 + 0  = 192
A8 -> A = 10, so 10 × 16 + 8  = 168
01 -> 0 =  0, so  0 × 16 + 1  =   1
01 -> 0 =  0, so  0 × 16 + 1  =   1
                                -----
                                192.168.1.1

Example: 0xAC100001

Strip the prefix to get AC100001. Split into AC, 10, 00 and 01. AC is 10 × 16 + 12 = 172. 10 is 1 × 16 + 0 = 16. 00 is 0. 01 is 1.

Result: 172.16.0.1

That falls inside the RFC 1918 range 172.16.0.0/12, so it is a private address — the same block that starts at AC100000.

Reading a hex mask

Masks are often written in hex too, because the mask is a machine word and hex makes the bit pattern visible. FF is all ones, 00 is all zeros, and the boundary shows up as the first non-FF byte.

Hex masks and their prefixes
Hex maskDotted decimalPrefixHost bits
FFFFFF00255.255.255.0/248
FFFFFF80255.255.255.128/257
FFFFFFC0255.255.255.192/266
FFFFFFE0255.255.255.224/275
FFFFFFF0255.255.255.240/284
FFFFFFF8255.255.255.248/293
FFFFFFFC255.255.255.252/302
FFFFFFFE255.255.255.254/311
FFFFFFFF255.255.255.255/320
FFFF0000255.255.0.0/1616
FF000000255.0.0.0/824

Counting the trailing zero bits is the same as counting host bits. FFFFFF00 has eight zero bits, so it is a /24; FFFFFF00 in a 32-bit word with no leading zeros padded is still /24, because the leading bits are implied ones up to the 32nd position.

Common mistakes

  • Forgetting that A-F are 10-15. Treating A as 1 or as 10 in the wrong position shifts the result badly. A8 is 168, not 108.
  • Padding on the right. A short value is missing leading zeros. AC10 becomes 0000AC10, giving 0.0.172.16, not 172.16.0.0.
  • Byte-reversing unnecessarily. The standard textual hex form is already in network order. Only reverse when you know the source is little-endian.
  • Assuming the value is a whole address when it is a prefix. A value like FFFFFF00 is a mask, not an address, and converting it as an address gives 255.255.255.0 — technically a valid-looking address but almost certainly not what was intended.

Also: IP to Hex Converter · IP to Binary Converter · Binary to IP Converter · IP to Decimal Converter · Decimal to IP Converter

Reference: hex digits to decimal

Hexadecimal digit values
HexDecimalBinaryNotes
000000All four bits clear
110001Least significant bit set
770111Largest single-digit hex value in class A range
881000Most significant bit of a nibble set
A101010First letter; 10 in decimal
C121100First digit of 192-223 addresses
E141110First digit of 224-239 addresses
F151111All four bits set; two Fs make 255

Reverse direction: IP to hex. Related: binary to IP, decimal to IP, full IP converter.

Frequently asked questions

How do I convert hexadecimal to an IP address?

Split the eight hex digits into four pairs, convert each pair to decimal, and join the results with dots. For C0A80101: C0 = 192, A8 = 168, 01 = 1 and 01 = 1, giving 192.168.1.1.

How do I convert a hex pair to decimal?

Multiply the first digit by 16 and add the second. For A8: A is 10, so 10 × 16 = 160, plus 8 = 168. For C0: C is 12, so 12 × 16 = 192, plus 0 = 192. Remember that A through F represent 10 through 15.

What if my hex value is shorter than eight digits?

Pad it with leading zeros. A four-digit value such as AC10 is only 16 bits, which is not a complete IPv4 address — pad it to 0000AC10 and it becomes 0.0.172.16, or treat it as a partial value that needs context. Every complete IPv4 address is exactly eight hex digits.

Does the 0x prefix matter?

Not for the value. This converter strips a leading 0x or 0X before parsing, so 0xC0A80101 and C0A80101 both produce 192.168.1.1. The prefix exists only to tell a programming language that the literal is base 16.

Can I paste a Wireshark-style hex dump?

You can paste the address portion with spaces, dots or colons as separators and they will be stripped. A full packet hex dump containing other fields will not work, because the tool expects exactly 32 bits of address data and cannot know which bytes in the dump are the address.

Why does my hex value look reversed?

Network protocols store multi-byte fields in big-endian order — most significant byte first — which is the same order as the dotted-decimal notation. If your value appears reversed, you are probably looking at a little-endian representation from a debugger or a memory dump, and you need to reverse the four bytes before converting.