Convert Decimal to Hexadecimal
Need to change a base 10 number into base 16? You can convert decimal to hex easily with our free tool. Just type your denary number below to get the right hex value.
Decimal to hex converter
Quick Reference
Decimal to Hexadecimal Conversion Chart
Here is a quick reference table showing common decimal numbers in hex format. Keep this decimal to hex chart handy when you want to skip the math.
| Decimal | Calculation | Hexadecimal |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 9 | 9 | 9 |
| 10 | 10 = A | A |
| 11 | 11 = B | B |
| 12 | 12 = C | C |
| 13 | 13 = D | D |
| 14 | 14 = E | E |
| 15 | 15 = F | F |
| 16 | 16 ÷ 16 = 1 remainder 0 | 10 |
| 26 | 26 ÷ 16 = 1 remainder 10 gives 1A | 1A |
| 31 | 31 ÷ 16 = 1 remainder 15 gives 1F | 1F |
| 64 | 64 ÷ 16 = 4 remainder 0 | 40 |
| 100 | 100 ÷ 16 = 6 remainder 4 | 64 |
| 127 | 127 ÷ 16 = 7 remainder 15 gives 7F | 7F |
| 255 | 255 ÷ 16 = 15 remainder 15 gives FF | FF |
Step by Step
How to Convert Decimal to Hexadecimal
Converting a decimal number to hex is pretty simple when you know the trick.
The Method
Decimal is the normal number system we use every day. It uses digits 0 through 9. Hexadecimal is a base 16 system. It uses 0 through 9 plus the letters A through F. To convert a decimal to hexadecimal by hand, you just divide your starting number by 16 repeatedly.
Each remainder becomes one hex digit. Any remainder from 10 through 15 is written as the letters A through F.
Converting Decimal to Hexadecimal
Write the decimal number
Take the base 10 number you want to convert. We will use 26 as our example.
Divide by 16
Divide the number by 16 and write down the remainder. For 26 you get 1 with a remainder of 10.
Convert remainders to hex digits
The remainder 10 becomes the letter A. Reading the quotient then the remainder gives you 1A. So 26 in decimal is 1A in hex.
Decimal vs Hexadecimal
Why Do We Use Both Systems?
Decimal and hexadecimal are simply different ways to count. Decimal is the normal system we use all the time. It gives us ten different numbers. Hexadecimal gives programmers a much shorter way to handle large values.
Computers run on binary code. Hexadecimal acts as a bridge between human readable text and machine code. When you want to translate between the two systems, a dec to hex calculator saves a lot of time.
You might also hear people talk about converting denary to hex. They mean the exact same thing.
Worked Examples
Sample Decimal to Hexadecimal Conversions
Let's look at how to convert some common base 10 numbers to hex.
10 in decimal to hex
The number 10 corresponds directly to the letter A. So 10 in decimal is A in hex.
15 in decimal to hex
The number 15 maps exactly to the letter F. So 15 in decimal is F in hex.
16 in decimal to hex
Divide 16 by 16. You get 1 with a remainder of 0. That makes it 10.
26 in decimal to hex
Divide 26 by 16. You get 1 with a remainder of 10. Since 10 turns into A, you are left with 1A.
64 in decimal to hex
64 divided by 16 equals 4 with no remainder. The answer is 40.
100 in decimal to hex
100 divided by 16 equals 6 with a remainder of 4. The result is 64.
255 in decimal to hex
255 divided by 16 equals 15 with a remainder of 15. The number 15 is F. This gives you FF.
1024 in decimal to hex
1024 divided by 16 is 64 with a remainder of 0. Then 64 divided by 16 is 4 with a remainder of 0. The final hex value is 400.
FAQ
Frequently Asked Questions
Everything you need to know about changing dec to hex.