Decimal To Hexadecimal
Have you ever wondered how computers talk? They use different number systems, and one of the most important is hexadecimal! This lesson will teach you how to translate the decimal numbers we use every day into the super-useful hexadecimal system using a simple division trick.

What Are Decimal and Hexadecimal Numbers?
Converting from decimal to hexadecimal means changing a number from base-10 to base-16. But what does that even mean? Let's break it down.
The decimal system, also called base-10, is the number system we use every day. It's called base-10 because it uses ten different digits to represent all possible numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. When we count past 9, we add a new place value (the tens place), like in the number 10.
The hexadecimal system is a base-16 system. As you might guess, this means it uses sixteen different digits! It uses the same ten digits from the decimal system (0-9), but it needs six more to get to sixteen. Instead of inventing new symbols, we use the first six letters of the alphabet: A, B, C, D, E, and F.
So, the sixteen digits in hexadecimal are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Here's how the letters match up to decimal values:
- A = 10
- B = 11
- C = 12
- D = 13
- E = 14
- F = 15
Let's see how they compare side-by-side. Notice how hexadecimal uses a single digit for numbers where decimal needs two.
| Decimal (Base-10) | Hexadecimal (Base-16) |
|---|---|
| 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 |
Look at that last row! The decimal number
Why Do We Need Another Number System?
You might be thinking, "The decimal system works just fine. Why learn a new one?" That's a great question! While we use base-10 for everyday counting, computers often use hexadecimal for very specific and important reasons.
Computers, at their core, only understand two things: ON and OFF. They use a base-2 system called binary, which only has two digits:
This is where hexadecimal becomes a hero. Hexadecimal is like a shorthand for binary. Every four binary digits can be represented by exactly one hexadecimal digit.
For example:
- The binary
is in decimal, which is in hexadecimal. - The binary
is in decimal, which is in hexadecimal.
So, the long binary number
You see hexadecimal numbers all the time, even if you don't realize it:
- Web Colors: Have you ever seen a color code like #FF0000? That's a hexadecimal number telling the computer to show the color red.
- Error Codes: When a computer program crashes, it might show an error code full of letters and numbers. Those are often hexadecimal values that help programmers figure out what went wrong.
- Memory Addresses: Every piece of data in a computer's memory has an address, which is almost always shown in hexadecimal because the numbers can get incredibly large.
By learning hexadecimal, you're learning a language that helps people communicate with computers more efficiently.
How Do You Convert from Decimal to Hexadecimal?
The most common way to convert a decimal number to hexadecimal is the repeated division method. It might sound complicated, but it's just a simple process of dividing by
Here are the steps:
- Divide by 16: Take your decimal number and divide it by
. - Record the Remainder: Write down the whole number remainder. This remainder is a hexadecimal digit! If the remainder is between
and , you must convert it to its letter equivalent (A, B, C, D, E, or F). - Use the Quotient: Take the whole number part of your answer (the quotient) and repeat the process. Divide it by
. - Keep Going: Continue dividing the new quotient by
until you get a quotient of . - Read Upwards: Once your quotient is
, your conversion is done! The hexadecimal number is the list of remainders you recorded, read from the bottom to the top.
Let's think about that last step. Why do we read the remainders from bottom to top? The first remainder you calculate is the value for the ones place (
Example 1: Converting a Two-Digit Decimal Number
Let's practice with a straightforward number. We'll convert the decimal number
Convert the decimal number
Step 1: Divide
Our quotient is
Step 2: Take the quotient from the last step, which is
Our new quotient is
Step 3: Read the remainders from the bottom up. The last remainder we found was
Reading upwards, we get: 4, then B.
So,
Example 2: Converting a Larger Decimal Number
Now let's try a bigger number that requires a few more steps. This will help you get comfortable with the repeated division process.
Convert the decimal number
Step 1: Divide
The remainder is
Step 2: Take the quotient,
The remainder is
Step 3: Take the new quotient,
The remainder is
Step 4: Assemble the hexadecimal number by reading the remainders from the bottom to the top. The remainders we found were, in order:
Therefore,

Example 3: A Conversion with Multiple Letters
This final example will show how multiple letters can appear in a hexadecimal number. The process is exactly the same, so don't be intimidated!
Convert the decimal number
Step 1: Divide
A remainder of
Step 2: Take the quotient,
The remainder is 8.
Step 3: Take the new quotient,
A remainder of
Step 4: Read the remainders from bottom to top. Our remainders, in the order we found them, were
So,
What Are Some Common Mistakes to Avoid?
When you're first learning to convert from decimal to hexadecimal, it's easy to make a few common mistakes. Being aware of them is the best way to avoid them!
- Reading Remainders Top-to-Bottom: This is the most frequent error. Always remember to write down your remainders and then read them from the last one you found to the first one (bottom-up). If you read them in the order you found them, your answer will be backward.
- Forgetting to Convert to Letters: Any time you get a remainder that is
or , you must change it to its hexadecimal letter (A, B, C, D, E, or F). Writing a remainder like "12" in your final answer is incorrect, as it would be read as the digits one and two. It must be written as "C". - Simple Division Errors: The whole process relies on correct division. Work carefully and double-check your subtraction when finding remainders. Using a calculator to check your division (e.g.,
) can help. To find the remainder from this, you can calculate . - Stopping Too Early: Don't stop dividing until the quotient is zero. Even if you get a quotient like
or (which is less than ), you still need to do one last division step. For example, gives a quotient of and a remainder of . That is a critical part of your final answer.
Quick Summary and Reference Chart
Here is a quick summary of the steps to convert any decimal number to hexadecimal, along with the reference chart for digits
Conversion Steps:
- Take the decimal number and divide it by
. - Write down the remainder. Convert it to a letter (A-F) if it's
or greater. - Take the whole number quotient from the previous step and divide it by
again. - Repeat until the quotient is
. - Write the list of remainders in reverse order (from bottom to top).
Hexadecimal Digit Reference:
| Decimal Value | Hexadecimal Digit |
|---|---|
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
Keep this chart handy when you're working. With a little practice, you'll have these memorized in no time!
Frequently Asked Questions
What does the word 'hexadecimal' mean?
The word 'hexadecimal' comes from two parts: 'hexa,' which is Greek for six, and 'deci,' which is Latin for ten. When you add them together,
Why do we use letters in hexadecimal numbers?
In any number system, each place value needs to be represented by a single digit. Since hexadecimal is base-16, it needs 16 unique digits. We use the familiar 0-9 for the first ten, and then use the letters A through F to represent the values 10 through 15 as single characters.
How do you show that a number is hexadecimal and not decimal?
To avoid confusion, programmers and mathematicians use special notations. They might add a subscript '16' like
What is the biggest single 'digit' in hexadecimal?
The largest single digit in the hexadecimal system is F. It represents the decimal value of 15. After F comes the number 10, which represents the decimal value of 16.
Is binary related to hexadecimal?
Yes, they are very closely related! One hexadecimal digit can represent exactly four binary digits (bits). This makes it a very convenient way for humans to read and write the long strings of 1s and 0s that computers use.
Where will I see hexadecimal numbers in real life?
You can find hexadecimal numbers in many digital places. They are used to define colors on websites (like #FFFFFF for white), in Wi-Fi passwords, in computer error messages, and to represent memory locations inside your computer or phone.
Can I use a calculator to convert from decimal to hexadecimal?
Yes, many scientific and programmer calculators have a function to convert between number bases. While this is a great tool for checking your work, it's very important to learn the division method so you understand how the conversion actually works.