Beetwise

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.

  1. Digit 1 at position 2: 1 x 256 = 256
  2. Digit 2 at position 1: 2 x 16 = 32
  3. Digit C at position 0: 12 x 1 = 12
  4. Add the parts. The total is 300.

The weight of each hex position

The weight of each hex position
PositionWeightDecimal value
016^01
116^116
216^2256
316^34096
416^465536
516^51048576
616^616777216
716^7268435456

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 editor

Questions 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.