Decimal to Hex Converter With Steps

Enter a decimal number to see it in hex, with the working.

Hexadecimal

How it works

Divide the number by 16 and note the remainder. Divide the result by 16 again, and repeat until you reach 0. Turn any remainder from 10 to 15 into its letter, A to F. Reading the remainders from last to first gives the hex number.

A common everyday use is colour. Screen colours are three numbers from 0 to 255 for red, green and blue. Each one becomes two hex digits, which is where codes such as #FF8800 come from: 255 red, 136 green, 0 blue.

If you already have the number in binary, it is faster to group the bits in fours than to divide.

Worked example

419: 419 ÷ 16 = 26 remainder 3. 26 ÷ 16 = 1 remainder 10, which is A. 1 ÷ 16 = 0 remainder 1. Read upward: 1A3.

Decimal, binary, octal and hex from 0 to 15

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Common questions

What is 255 in hex?

FF.

What is 100 in hex?

64. That is 6 times 16, which is 96, plus 4.

Related tools