HomeConvertersNumber systemsHow to convert decimal to hex
Number conversion

How to convert decimal to hex

How to convert from decimal number to hexadecimal number. How to convert base 10 to base 16.

Instant result
Result

Enter values to convert.

Inputs
Mode
Formula

How to convert from decimal number to hexadecimal number.

How to convert base 10 to base 16.

How to convert from decimal to hex

For decimal number x:

  • Get the highest power of 16 that is less than the decimal number x:
max(16n)  603

So

n = 2
d2 = int(603 / 162) = 2
Δ = 603 - 2×162 = 91
n = 1, x = Δ = 91
d1 = int(91 / 161) = 5
Δ = 91 - 5×161 = 11
n = 0, x = Δ = 11
d0 = int(11 / 160) = 1110 = B16
Δ = 11 - 11×160 = 0
(d2d1d0) = 25B
So
x = 60310 = 25B16

How to convert hex to decimal →