Binary Translator

Hex to Decimal Converter

To convert hex to decimal, multiply each hexadecimal digit by a power of 16, counting from 16^0 on the right, and add the results. For example 0xFF is 255, because F is 15 and 15 × 16 + 15 = 255. Enter a hex number below to see every step.

Decimal result

255

Working

  1. Write the place values from the right, starting at 16^0: the 2 digit(s) cover 16^1 down to 16^0.
  2. F × 16^1 = 15 × 16 = 240
  3. F × 16^0 = 15 × 1 = 15
  4. Add the products: 240 + 15 = 255.

Example: 0xFF to decimal

  • Write the place values from the right, starting at 16^0: the 2 digit(s) cover 16^1 down to 16^0.
  • F × 16^1 = 15 × 16 = 240
  • F × 16^0 = 15 × 1 = 15
  • Add the products: 240 + 15 = 255.
  • Result: 255
  • Largest signed 32-bit value: 7FFFFFFF = 2147483647

How hex digits map to values

Hexadecimal is base 16, so it needs sixteen symbols: 0-9 for the values zero to nine and A-F for ten to fifteen. The letters are not case sensitive, so ff, Ff and FF all read the same. The rightmost digit is worth 16^0 (1), the next 16^1 (16), then 256, 4096 and so on. The working shows each non-zero digit, its value and its place value, then the sum.

The converter accepts an optional 0x prefix, spaces or underscores between digits, and numbers of any length, because it uses arbitrary-precision integers. The largest signed 32-bit value, 7FFFFFFF, is 2147483647; there is no 32-bit or 64-bit ceiling in this tool.

Negative hex values and two’s complement

Negative numbers: a leading minus sign is treated as a sign and the digits are converted as the absolute value, so the sign is simply kept in front of the result. This is not two’s complement, which is how processors store negative integers and which depends on a fixed bit width. The tool does not assume a width, so it never reinterprets a high bit as a sign.

If you are reading a 32-bit signed value such as FFFFFFFF, convert it normally (4294967295) and, when the top bit is set, subtract 2^32 (4294967296). That gives -1. For 8 bits, subtract 256 instead.

Common mistakes

The most common error is a character that is not a hex digit, such as G, a decimal point or a comma. The tool names the character and tells you which digits are allowed. Fractions are not supported; enter whole numbers only.

Decimal, binary, hex and octal table (0-15)

Values 0 to 15 in four bases
DecimalBinary (4-bit)HexOctal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000810
91001911
101010A12
111011B13
121100C14
131101D15
141110E16
151111F17

Frequently asked questions

What is 0xFF in decimal?
255. F is 15, so 15 × 16 + 15 = 255, the largest value of one byte.
What is 0x7FFFFFFF in decimal?
2147483647, the largest signed 32-bit integer.
Does it work without the 0x prefix?
Yes. The prefix is optional; FF and 0xFF give the same answer.
How do I convert hex to decimal by hand?
Write each digit as a value from 0 to 15, multiply it by 16 raised to its position from the right, and add everything up.