Converting Hexadecimal To Decimal
Converting Hexadecimal To Decimal
Steps:
1. Get the last digit of the hex number, call this digit
the currentDigit.
2. Make a variable, let's call it power. Set the value to 0.
3. Multiply the current digit with (16^power), store the result.
4. Increment power by 1.
5. Set the the currentDigit to the previous digit of the hex
number.
6. Repeat from step 3 until all digits have been multiplied.
7. Sum the result of step 3 to get the answer number.
Example 1
Convert the number 1128 HEXADECIMAL to DECIMAL
Counting the number of digits takes extra time, and you might
count wrongly.
If you don't remember what a particular value of a power-of-
16 is, it's easier to calculate it from the previous power value.
For instance, if you don't remember what the value of 16^3 is,
then just multiply the value of 16^2 (which you'll likely already
have if you started backward) with 16.
Example 2
Convert the number 589 HEXADECIMAL to DECIMAL
MULTIPLICATION RESULT
9 x (16^0) 9
8 x (16^1) 128
5 x (16^2) 1280
ANSWER 1417
If you want to be a speed counter, it's beneficial to memorize the
values of the smaller power of 16s, such as in this table
MULTIPLICATION RESULT
1x1 1
3 x 16 48
5 x 256 1280
1 x 4096 4096
ANSWER 5425
1. Divide the decimal number by 16. Treat the division as an integer division.
2. Write down the remainder (in hexadecimal).
3. Divide the result again by 16. Treat the division as an integer division.
4. Repeat step 2 and 3 until result is 0.
5. The hex value is the digit sequence of the remainders from the last to first.
Note: a remainder in this topic refers to the left over value after performing an integer
division.
HEXADECIMAL 0 1 2 3 4 5 6 7 8 9 A B C D E F
DECIMAL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
REMAINDER (in
NOTES DIVISION RESULT
HEXADECIMAL)
Start by dividing the
number by 16.
In this case, 70 / 16 4 6
70/16=4.375. So the
integer division result is 4
(throw out anything after
the decimal point)
Example 2
Convert the number 256 DECIMAL to HEXADECIMAL
DIVISION RESULT REMAINDER (in HEX)
256 / 16 16 0
16 / 16 1 0
1 / 16 0 1
ANSWER 100
Example 3
Convert the number 921 DECIMAL to HEXADECIMAL