Decimal to Hexadecimal Converter

Enter a decimal number below to convert it to hex.

Hexadecimal Number:

 

Steps to Convert to Hexadecimal

 
 
Learn how we calculated this below

scroll down


On this page:


How to Convert Decimal to Hex

The decimal number system is the number system many use daily. The decimal number system, also referred to as denary, is a base 10 number system, meaning it is comprised of 10 digits, 0, 1, 2, 3, 4, 5, 6, 7, 8 & 9.

Hexadecimal numbers, also referred to as hex, are base 16 numbers. They are often used in computing applications because two hex digits can cleanly represent one binary byte.

Hexadecimal Digits

Hex numbers use the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e & f. This table shows the decimal value for each hexadecimal digit.

Equivalent decimal values for each hex digit.
Hexadecimal Digit Decimal Value
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
a 10
b 11
c 12
d 13
e 14
f 15

Steps to Convert

Now that you understand the representation of a base 16 number, you can convert from decimal to hex using successive division by 16. Whoa, you’re probably wondering what that even means.

To use the successive division method, divide the decimal number by 16 using long division. There should be a remainder of 0 through 15; write that to the side of the division problem. For remainders larger than 9, use the table above to find the equivalent hex digit.

Take the result of the first division problem and divide that by 16 again. Like before, there should be a remainder, which you should write to the side of the problem.

Continue this process until the result is 0.

The remainders that you wrote to the side of the division problems are the resulting hexadecimal number. The number should be read from the bottom to the top since the least significant digit will be at the top, and the most significant digit will be at the bottom.

graphic showing how to convert a decimal number to hex

For example, let’s convert 445 from base 10 to base 16.

445 ÷ 16 = 27 R 13 (13 → d)
27 ÷ 16 = 1 R 11 (11 → b)
1 ÷ 16 = 0 R 1

Reading the remainders from the bottom up is 1bd, so 44510 is equivalent to 1bd16.

Want to convert back to decimal to confirm this answer? Try our hex to decimal converter.

Decimal to Hex Conversion Table

The table below shows decimal numbers and the equivalent hex number values.

Decimal numbers converted to the equivalent hex values
Decimal Number Hexadecimal Number
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 a
11 b
12 c
13 d
14 e
15 f
16 10
17 11
18 12
19 13
20 14
21 15
22 16
23 17
24 18
25 19
26 1a
27 1b
28 1c
29 1d
30 1e
31 1f
32 20
64 40
128 80
256 100
512 200
1024 400
2048 800

Frequently Asked Questions

What is the advantage of hexadecimal over decimal?

Hexadecimal is often used since it is a more concise representation of a number. Because it uses 16 digits, it requires significantly fewer characters to represent a number than other number systems such as decimal or binary.

Why does hexadecimal stop at F?

The values 0-15 must be represented in hexadecimal, however, there are no single-digit numbers that can represent the values 10-14. Therefore letters are used to represent the values. The value 15 is represented as F.

Why is hex written with 0x?

Without a prefix, the number system used to represent the value could be ambiguous. Prefixing a number with 0x lets the computer know that you are using the hexadecimal number system rather than binary, decimal, octal, or any other system.

Using a zero in front of the “x” in the 0x prefix is used to indicate to computer systems that the value is a number and not a different identifier or variable.