Decimal to hexadecimal converter

Type a decimal number and get its hexadecimal value instantly, together with binary, decimal, hexadecimal and octal, the bit count and a copy button. Free, in your browser.

  • Free
  • No sign-up
  • Runs in your browser
decimal-to-hex

Fill in the values above to see the result.

100% private — the calculation is done in your browser and nothing is sent to any server.

How it works

Enter the number

Type a decimal number in the box; the base is already selected.

Read the result

Hexadecimal, decimal, hexadecimal, binary and octal appear together.

Copy it

Use the copy button next to the value you need.

How to convert decimal to hexadecimal

To convert decimal to hexadecimal, type your number in the converter above and read the hexadecimal value. For example, 214 in decimal is D6 in hexadecimal. The other bases are shown at the same time.

Why convert decimal to hexadecimal

Developers convert decimal to hex to write colours (255, 128, 0 is FF8000), set memory offsets, build byte arrays and read register maps. The number 214 becomes D6: two digits instead of three, and a value that lines up neatly with a byte.

Convert decimal to hexadecimal by hand

Here is 214 (decimal) converted step by step:

  1. Divide the number by 16 repeatedly and note each remainder: 214 ÷ 16 = 13 remainder 6, 13 ÷ 16 = 0 remainder D.
  2. Stop when the quotient reaches 0.
  3. Read the remainders from last to first: D6.

Decimal steps of 16 in hex

steps16
DecimalHexBinary
00000000000
161000010000
322000100000
483000110000
644001000000
805001010000
966001100000
1127001110000
1288010000000
1449010010000
160A010100000
176B010110000
192C011000000
208D011010000
224E011100000
240F011110000
255FF11111111

More decimal to hexadecimal examples

examples
DecimalHexadecimalDecimal
10A10
422A42
10064100
255FF255
30012C300
10003E81000
4095FFF4095
65535FFFF65535

Check your answer

To check the result, convert it back: D6 in hexadecimal is 214 in decimal. Your input may only contain the decimal digits 0 1 2 3 4 5 6 7 8 9; any other character is not a valid decimal number.

Good to know

  • Divide by 16: the last remainder is the first digit of the result.
  • Values from 0 to 255 always fit in two hex digits.
  • Hex digits above 9 are letters: 10 is A, 11 is B and so on up to 15, which is F.
  • The converter also shows the other bases at the same time, so a single entry gives you binary, decimal, hexadecimal and octal.

Frequently asked questions

How do I convert decimal to hexadecimal?
Type the number in the converter at the top of this page and read the hexadecimal value. For example, 214 (decimal) is D6 (hexadecimal).
How do I convert a decimal colour value to hex?
Convert each of the red, green and blue values (0 to 255) to two hex digits and join them: 255, 128, 0 gives FF8000.
Why are hex numbers shorter than decimal ones?
Each hex digit carries four bits, against about 3.3 bits for a decimal digit, so the same value takes fewer characters.
How many bits does 214 need?
214 is 214 in decimal, which needs 8 bits in binary.
Is this converter free and private?
Yes. It is free, needs no sign-up and works in your browser, so what you type is never sent to a server.