How the conversion works
Multiply each hex digit by 16 raised to its position index (starting from 0 on the right) and sum all the products. Digits A through F carry values 10 through 15.
For example, hex 1A3 equals 1 times 256 plus 10 times 16 plus 3 times 1, which gives decimal 419.
decimal = sum of (digit_i * 16^i)
Each hex digit is multiplied by 16 raised to its position, starting from 0 on the right.