Hex to Decimal Converter

Decimal and binary equivalents of a hex value, A to F in either case.

Result

16734003
111111110101011100110011

How it is calculated

Each hex digit has a value from 0 to 15 (A=10 up to F=15). The decimal value is the sum of each digit times a power of 16, counting from the right: value = Σ digit × 16position, with the rightmost digit at position 0. The binary result is the same number written in base 2. Upper or lower case letters both work, and a leading 0x is stripped. The input must be non-empty and contain only 0-9 and A-F, so a leading #, spaces or a minus sign make it invalid. Values are limited to 64-bit signed integers: up to 7FFFFFFFFFFFFFFF, which is 9223372036854775807. Anything larger returns no result. Negative and fractional hex numbers are not supported.

Worked example

Convert the colour code digits FF5733. Split into bytes: FF = 15×16 + 15 = 255, 57 = 5×16 + 7 = 87, 33 = 3×16 + 3 = 51. Combine: 255 × 65,536 + 87 × 256 + 51 = 16,711,680 + 22,272 + 51 = 16734003. In binary this is 111111110101011100110011, which is 24 bits because each hex digit is 4 bits.

Try this example →

Common mistakes

  • Typing the colour code with its # (as in #FF5733); the tool accepts only hex digits and an optional 0x prefix, so remove the hash.
  • Reading the letter O as the digit 0, or the letter l as 1; neither is a hex digit and the input is rejected.
  • Treating the result as a negative number for values like FFFFFFFF; the tool reads hex as unsigned (4294967295), not as a two's complement 32-bit value (−1).
  • Pasting several bytes with spaces (for example 1F 2A); remove the spaces or convert each byte separately.
  • Expecting hex digits beyond 16 characters to work; numbers above 7FFFFFFFFFFFFFFF are refused.

About this calculator

Hexadecimal is base-16, using digits 0-9 and A-F, and each hex digit maps exactly onto 4 binary bits, which is why it's the standard shorthand for memory addresses, colour codes (#FF5733), and byte values in programming — far more compact than binary and easier to read at a glance. Converting to decimal sums each digit's value times 16 raised to its positional power, e.g. hex 2A = 2×16¹ + 10×16⁰ = 42.

Programmers, students learning number systems, and low-level/embedded developers reading register dumps or debugger output use this conversion constantly, since decimal is the natural unit for everyday quantities while hex (and binary) map directly onto how computers store data.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The tool reads the hex as an unsigned number, which matters for register and byte values. A single byte of 80 comes out as 128, but if the field is a signed byte it means minus 128: for any result of 128 or more in a one-byte field, subtract 256 to get the signed value. What do you decode most often, colour codes, register dumps or something else?

Popular calculators

All Calculators