fast&private

Convert Decimal to Hexadecimal

Convert a decimal number to hexadecimal.

Your data is never sent to any server.

The decimal to hexadecimal converter turns any base 10 number into the base 16 system used by CSS colors, memory addresses and data dumps.

The divide-by-16 method

DivisionQuotientRemainderDigit
255 / 161515F
15 / 16015F

Reading bottom to top: FF. For larger numbers the process is identical, just with more steps.

The table worth keeping handy

DecimalHexDecimalHex
10A14E
11B15F
12C1610
13D255FF

Note that decimal 16 is already 10 in hexadecimal: each position is worth sixteen times the previous one, just as each decimal position is worth ten times.

Need the other direction? Go to hex to decimal.

How to use Decimal to Hex

  1. 1

    Type the decimal number

    Enter the base 10 number in the input field.

  2. 2

    Read the hexadecimal value

    The base 16 result appears highlighted instantly, using digits 0 to 9 and letters A to F.

  3. 3

    Copy the result

    Press the copy button on the hexadecimal row. Add the 0x prefix or a hash afterwards if your target needs one.

  4. 4

    Check the other bases

    Below you get the same number in binary and octal, in case you are working with bits or file permissions.

Frequently asked questions

How do you convert decimal to hexadecimal by hand?

Divide by 16 repeatedly and note the remainders, then read them bottom to top. Remainders from 10 to 15 are written as A, B, C, D, E and F.

Why does hexadecimal use letters?

Because base 16 needs sixteen distinct symbols and decimal digits only go up to ten. Values 10 to 15 use the letters A–F so each one still takes a single character.

What is 255 in hexadecimal?

FF. It is the maximum value of a byte and therefore the maximum of each channel in a color such as #FFFFFF, which is pure white.

Does the result include the 0x prefix?

No, the clean value is returned so you can paste it wherever you need. Add 0x in C, Python or JavaScript, or a hash if it is a CSS color.

Should the letters be upper or lower case?

It makes no difference to the value: FF and ff are the same number. The tool returns them in upper case; if your code uses lower case, change them freely.