The simplest way to convert unsigned numbers from decimal to hexadecimal is to transform the number first in binary, as the binary to hex conversion is trivial.

For instance:

99_{10} = 1*64 + 1*32 + 0*16 + 0*8 + 0*4 + 1*2 + 1*1 = 1*2^{6} + 1*2^{5} + 0*2^{4} + 0*2^{3} + 0*2^{2} + 1*2^{1} + 1*2^{0}.

99_{10} = 1100011_{2}

To convert a value from binary to hexadecimal, you first add a number of 0's to the left of the most significant bit of the binary number, so the
number of bits of the new binary number is a multiple of 4. Then, you simply translate each 4-bit binary nibble to its hexadecimal digit equivalent.

99_{10} = 1100011_{2} = 0110 0011_{2} = 0x63.

Decimal to Hexadecimal Converter

#### Decimal to hexadecimal conversion quiz: