Introduction
You might know how to convert hexadecimal values to decimal values using a website like Geckocodes or the Windows Calculator but what about doing it manually?
First of all you need to know that hexadecimal is base 16. The following table explains which hexadecimal digit converts into which decimal number.
Conversion Table
Decimal | Hexadecimal |
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
10 | A |
11 | B |
12 | C |
13 | D |
14 | E |
15 | F |
Note that after 9 the next number in hexadecimal is A and NOT 10. 10 is 16 in decimal. The letters from A to F can also be written in lowercase so it comes down to personal preference whether you spell them in capital or not.
Hexadecimal To Decimal
In order to convert a hexadecimal number to decimal we need to take the digits individually from the right of the given number, convert them to decimal using the table above and multiply each of them with where is the current index of the digit we took starting at . Finally, all products are added up.
For the ones who love formulas:
where is the length of the number to convert, the number to convert and the table lookup/conversion function using the table from above.
Example
Task:
Convert to decimal manually.
Answer:
The result of the expression on the left can be calculated with for example WolframAlpha if you don't want to do the math by hand.
Enjoy
Last edited by Bully@WiiPlaza on 1/21/2020, 8:22 am; edited 1 time in total