Hex to Decimal Converter

Every hex digit is a power of 16 — expand and sum. 0x prefixes, byte groups and lowercase all accepted, signed and unsigned readings side by side, exact at any length.

Result
Waiting for input — conversion happens instantly in your browser.

One Byte, Two Answers: Signed vs Unsigned

The same hex value can mean two different decimal numbers — which one is right depends on whether a sign bit is in play.

Unsigned reading — the plain value

0xB4 is 180: B = 11 × 16¹ = 176, plus 4 × 16⁰ = 4. This is the right answer for byte counts, color channels, offsets and memory addresses — values that are never negative.

Signed reading — two’s complement

The same 0xB4 in a signed 8-bit context is −76, because the leading bit is 1 and the value is read as 180 − 2⁸. This is the right answer for signed bytes in registers, protocols and two’s-complement arithmetic.

Toggle Signed above and pick the bit width (8/16/32/64) to see both readings; the tool flags the value honestly when it does not fit. Color codes work the same way: FF5733 — with or without the # — comes back as per-byte decimals 255 87 51, which is exactly the RGB triple.

How Hex to Decimal Works

Position is everything: the rightmost digit counts 16⁰ = 1, the next counts 16¹ = 16, then 16² = 256, and so on. Multiply each digit’s value by its position weight and add.

0xE7A9 expanded digit by digit — the same expansion the converter lists under “Show the calculation step by step”.
DigitValue× 16^positionContributes
E1414 × 16³57344
777 × 16²1792
A1010 × 16¹160
999 × 16⁰9
Sum59305

Going the other way — decimal to hex — you divide by 16 instead of multiplying: keep the remainders, read them bottom to top. 255 ÷ 16 = 15 remainder 15 → F, then 15 ÷ 16 = 0 remainder 15 → F, so 255 = 0xFF. Switch the direction above and the step list shows each division. And when what you actually needed was the bits, not the number, the hex to binary converter expands every digit into its 4-bit pattern — the two pages are sibling views of the same value.

One honest limit: hex here means numbers. A string of hex digits that was really text — like 4869 meant as “Hi” — decodes through the hex to text converter instead.

Common Hex Values in Decimal

The numbers that come up most — powers of 16, full-width byte values, and the signed/unsigned pairs people actually check.

HexDecimal (unsigned)As signed 8-bitWhere you see it
0x101616One 16-place shift
0x203232ASCII space; usual byte stride
0x4064640x40 = the @ sign in ASCII
0x558585Alternating-bit test pattern 01010101
0x7F127127Largest positive signed byte
0x80128−128Most negative signed byte
0xB4180−76The classic sign-bit trap
0xFF255−1Largest unsigned byte
0x100256—One past the byte range
0x3FF1023—10-bit max (common ADC depth)
0xFFFF65535−1 (16-bit)Largest unsigned 16-bit
0xFFFFFFFF4294967295−1 (32-bit)Largest unsigned 32-bit

Common Mistakes

  • Mistake: reading a signed byte as unsigned. A register dump shows B4 and you enter 180 into your notes — but the field was signed, and the true value was −76. Correction: check the field width and the Signed toggle; the tool shows both readings.
  • Mistake: padding a number into pairs when it is a number, not bytes. ABC is 2748 as a value; treating it as “AB C?” and stopping is a bytes-habit, not a number rule. Correction: this converter accepts odd digit counts because a hex number needs no pairs — byte pairing only matters on the hex to binary page.
  • Mistake: typing 0x twice — “0x0xFF”. Correction: one prefix is stripped per token, so the second 0x surfaces as an invalid character at its exact position; the error names it rather than swallowing it.
  • Mistake: decimal fractions. 10.5 in the Decimal → Hex direction fails on purpose — this page keeps hex byte-clean. Correction: convert the integer part here and keep fractional work on the binary to decimal converter, which handles binary points honestly.
  • Mistake: trusting a rounded result. JavaScript’s plain number type is only safe to 2⁵³−1; a 64-bit address like 0xFFFFFFFFFFFFFFFF silently rounds on naive tools. Correction: this converter uses arbitrary-precision math, so FFFFFFFFFFFFFFFF really is 18446744073709551615.

Hex to Decimal FAQ

How do I convert hex to decimal?

Multiply each hex digit by 16 raised to its position counted from the right, then add the products. For 0x2F: F is 15 × 16⁰ = 15 and 2 is 2 × 16¹ = 32, so 0x2F = 47. The converter above does this instantly and shows every step.

Is 0xB4 equal to 180 or −76?

Both, depending on context. As an unsigned byte 0xB4 is 180. As a signed 8-bit value the same bits mean −76, because the top bit marks the sign and 180 − 2⁸ = −76. Toggle Signed above to see the two’s-complement reading.

What is FF in decimal?

FF is 255 — the largest value one unsigned byte can hold. FFFF is 65,535 (16 bits) and FFFFFFFF is 4,294,967,295 (32 bits). With Signed enabled at the matching width, FF reads as −1 instead.

Can I convert a hex color like #FF5733 to RGB?

Yes — paste it without the # (or with it, the cleaner strips it). With an even number of digits the report line shows the decimal value of each byte pair, so FF5733 reads as 255 87 51 — exactly the RGB channels.

Do I need the 0x prefix?

No. 0x is only a C-style marker meaning “hex follows” — it is not part of the value. This converter strips 0x prefixes, spaces, commas and underscores and tells you what it removed.

How do I convert decimal back to hex?

Divide by 16 repeatedly and collect the remainders — the hex digits appear in reverse order. 255 ÷ 16 = 15 remainder 15 (F), then 15 ÷ 16 = 0 remainder 15 (F), giving FF. Switch to the Decimal → Hex direction above and the tool lists each division.