# Decimal to Hex

This converter converts the given decimal number to hex.

## Decimal to Hex

Decimal to hexadecimal (hex) conversion is the process of converting a decimal (base-10) number into its hexadecimal (base-16) representation.

In the decimal system, numbers are expressed using the digits 0 through 9, and in the hexadecimal system, numbers are represented using the digits 0 through 9 and the letters A to F, where A stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15.

## Stesp to convert decimal to hexadecimal

Here are the steps to convert a decimal number to hexadecimal:

- Divide the decimal number by 16.
- Record the remainder (which can be any digit from 0 to 15).
- Divide the quotient obtained in step 1 by 16.
- Record the remainder again.
- Repeat steps 3 and 4 until the quotient becomes 0.
- The hexadecimal equivalent is the sequence of remainders read in reverse order.

## Example

Let's take an example to illustrate the process. Suppose we want to convert the decimal number **255** to hexadecimal:

- 285 ÷ 16 = 17 (E in hexadecimal) with a remainder of 13 (D in hexadecimal).
- 17 ÷ 16 = 1 with a remainder of 1.
- 1 ÷ 16 = 0 with a remainder of 1.

Reading the remainders in reverse order gives us the hexadecimal equivalent: 11D.

Therefore, **285** in decimal is equal to **11D** in hexadecimal.