HEX numbers are composed of digits 0 through 9 like DEC but also adds A-F. So when counting in HEX:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12 ... 1A, 1B, 1C ... 1F, 20 ...
| HEX | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| DEC | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Here is a HEX number:
1E5DF
To convert this to a DEC, we need to define the base for our power function. Since HEX is based on 16 different digits [0-9A-F], our base is 16.
To convert from HEX to DEC, follow these steps:
| We know that F = 15 in DEC so we use this formula | (15*160) = 15 |
| We know that D = 13 in DEC so we use this formula | (13*161) = 208 |
| We know that 5 = 5 in DEC so we use this formula | (5*162) = 1280 |
| We know that E = 14 in DEC so we use this formula | (14*163) = 57344 |
| We know that 1 = 1 in DEC so we use this formula | (1*164) = 65536 |
Now we add all of the numebrs together to get the DEC number for HEX number 1E5DF:
15 + 208 + 1280 + 57344 + 65536 = 124383
So our answer is HEX 1E5DF = DEC 124383
Converting from DEC to HEX is a little more difficult. Let us start with a small DEC number. Let us use DEC 300. First we divid the DEC number by 16 (the number of digits in HEX). Now write down the remainder (300/16 = 18 remainder 12). The remainder is converted to HEX [DEC 12 = HEC C].
Now we divide 18 by 16 (18/16 = 1 remainder 2). Again, the remainder is converted to HEX [DEC 2 = HEX 2].
We divide 1 by 16 (1/16 = 0 remainder 1). Again, the remainder is converted to HEX [DEC 1 = HEX 1].
Finally, we put the numbers together. The remainder from our first division [HEX C] goes into the one place. Our remainder from our second division goes into the tens place. And our last remainder goes into the hundreds place.
So our answer is DEC 300 = HEX 12C
One more go! Let us try to convert DEC 10,000 to HEX.
| Division | Quotient | Remainder |
| 10,000/16 | 625 | 0 |
| 625/16 | 39 | 1 |
| 39/16 | 2 | 7 |
| 2/16 | 0 | 2 |
So our answer for DEC 10,000 = HEX 2710
Now that we have converted from HEX to DEC, you can apply the same logic to other converstion. If we want to convert from Ternary (base of 3) we would simply replace 16N with 3N.
Here are some common base numbers:
| Name | Base | Counting Symbols |
| Binary | base 2 | 0, 1 |
| Ternary | base 3 | 0, 1, 2 |
| Quaternary | base 4 | 0, 1, 2, 3 |
| Quinary | base 5 | 0, 1, 2, 3, 4 |
| Octal | base 8 | 0, 1, 2, 3, 4, 5, 6, 7 |
| Decimal | base 10 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
| Hexadecimal | base 16 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F |
| Vigesimal | base 20 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I, J |
| Alpha-Numerical | base 36 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I, J, K, L ,M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z |
Let us try to convert DEC 653 to Ternary.
| Division | Quotient | Remainder | 10N | Remainder * 10N | Tally |
| 653/3 | 217 | 2 | 100 | 2 | 2 |
| 217/3 | 72 | 1 | 101 | 10 | 12 |
| 72/3 | 24 | 0 | 102 | 0 | 12 |
| 24/3 | 8 | 0 | 103 | 0 | 12 |
| 8/3 | 2 | 2 | 104 | 20000 | 20012 |
| 2/3 | 0 | 2 | 105 | 200000 | 220012 |
So our answer for DEC 653 = Ternary 220012
Let us try to convert Quinary 43210 to DEC.
| Formula | Product | Tally |
| 0 * 50 | 0 | 0 |
| 1 * 51 | 5 | 5 |
| 2 * 52 | 50 | 55 |
| 3 * 53 | 375 | 430 |
| 4 * 54 | 2500 | 2930 |
So our answer for Quinary 43210 = DEC 2930
Let us try to convert Vigesimal ICED to DEC.
| Formula | Product | Tally |
| D (13) * 200 | 13 | 13 |
| E (14) * 201 | 280 | 293 |
| C (12) * 202 | 4800 | 5093 |
| I (18) * 203 | 144000 | 149093 |
So our answer for Vigesimal ICED = DEC 149093
Let us try to convert Alpha-Numerical PIZZA to DEC.
| Formula | Product | Tally |
| A (10) * 360 | 10 | 10 |
| Z (35) * 361 | 1260 | 1270 |
| Z (35) * 362 | 45360 | 46630 |
| I (18) * 363 | 839808 | 886438 |
| P (25) * 364 | 41990400 | 42876838 |
So our answer for Alpha-Numerical PIZZA = DEC 42876838
The generic formula to convert from a base to decimal is:
Where is the highest nth digit in the number to convert and
is the base to the power of one less than the total number of digits to be converted.
http://www.subnetonline.com/tools/dechexbin.html
http://www.comsc.ucok.edu/~mcdaniel/hex.html