Convert hex to decimal
To convert a hex value into decimal, take each digit and its position.
Each position holds a power of 16.
Multiply each digit by its power of 16, then add the results.
Try hex to decimal conversion in the bit editor
The value 0x12C, which is 300. Edit the expression or select a bit to flip it.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
300
value · 16 bits · unsigned
- hex
- 0x012C
Hex to decimal conversion step by step
Convert 0x12C into a decimal value: The steps follow the value above.
- Digit 1 at position 2: 1 x 256 = 256
- Digit 2 at position 1: 2 x 16 = 32
- Digit C at position 0: 12 x 1 = 12
- Add the parts. The total is 300.
The weight of each hex position
| Position | Weight | Decimal value |
|---|---|---|
| 0 | 16^0 | 1 |
| 1 | 16^1 | 16 |
| 2 | 16^2 | 256 |
| 3 | 16^3 | 4096 |
| 4 | 16^4 | 65536 |
| 5 | 16^5 | 1048576 |
| 6 | 16^6 | 16777216 |
| 7 | 16^7 | 268435456 |
Where hex to decimal conversion is used
A crash dump and a register log both use hex.
A decimal form is easier to check against a range limit in a specification.
Hex to decimal conversion: points to note
- The digit A is 10 and the digit F is 15.
- A zero at the left does not change the value.
- A hex value of eight digits can exceed a 32-bit signed range. Check the signed mode of the register.
The full bit editor
The full editor holds many values, evaluates expressions across them, and reads live values from a serial port.
Open this value in the full editorQuestions about hex to decimal conversion
- What is 0xFF in decimal?
- The value 0xFF is 255. Both digits are 15, which gives 15 times 16 plus 15.
- What is 0xFFFFFFFF in decimal?
- As an unsigned 32-bit value it is 4294967295. As a signed 32-bit value it is -1.
- Is hex case sensitive?
- No. The values 0xff and 0xFF are the same.