Decimal to Hex Converter

Converting Decimal to Hexadecimal

Decimal and Hexadecimal are two ways to write numbers. In general, we use decimal numbers—also refered to as base 10—in our everyday lives. That means that there are 10 possible values (0-9) for each digit represented by a base 10 number. Hexadecimal is written base 16, which gives 16 possible values per digit (0-9, A-F). Hexadecimal is widely used in computer applications because it can perfectly represent a single byte using two digits. Large decimal numbers are also shorter when writing them using hexadecimal, which makes it useful for computer code where succinctness is emphasized.

The conversion between base 10 and base 16 is not terribly complex. The process is the same for converting to any other base.

  1. Divide the original decimal number by the new base value.
  2. The remainder of the division operation is the value of the first digit of the converted number.
  3. Divide the quotient of the division operation by the base value.
  4. The remainder from Step 3 will be the next digit (to the left) of the base number.

Example

The below is the representation of the conversion operation of 234810 to hexadecimal using the above steps.

DivisionQuotientRemainder
2348 / 1614612 (C)
146 / 1692 (2)
9 / 1609 (9)

Thus, the hexadecimal value of 234810 is 92C16.