Decimal To Hexadecimal

Download as PDF

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.

Decimal To Hexadecimal — an original Algebra911 reference diagram defining decimal to hexadecimal with its key formula and a worked example.
Decimal to Hexadecimal Conversion: A Beginner's Guide

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)
00
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F
1610

Look at that last row! The decimal number 16 is written as 10 in hexadecimal. This is because in base-16, the second place value represents groups of 16, not groups of 10. So, 1016 means one group of 16 and zero ones.

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: 0 (off) and 1 (on). A simple decimal number like 200 looks like this in binary: 11001000. That's a long string of numbers and very hard for humans to read quickly and accurately!

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 1100 is 12 in decimal, which is C in hexadecimal.
  • The binary 1000 is 8 in decimal, which is 8 in hexadecimal.

So, the long binary number 11001000 can be split into 1100 and 1000, which becomes the much shorter and easier-to-read hexadecimal number C8.

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 16 over and over again. You just need to keep track of the remainders.

Here are the steps:

  1. Divide by 16: Take your decimal number and divide it by 16.
  2. Record the Remainder: Write down the whole number remainder. This remainder is a hexadecimal digit! If the remainder is between 10 and 15, you must convert it to its letter equivalent (A, B, C, D, E, or F).
  3. Use the Quotient: Take the whole number part of your answer (the quotient) and repeat the process. Divide it by 16.
  4. Keep Going: Continue dividing the new quotient by 16 until you get a quotient of 0.
  5. Read Upwards: Once your quotient is 0, 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 (160). The next remainder is for the sixteens place (161), the next is for the two-hundred-fifty-sixes place (162), and so on. Reading them in reverse order puts these digits in their correct place values. We'll see this in action in our examples.

Example 1: Converting a Two-Digit Decimal Number

Let's practice with a straightforward number. We'll convert the decimal number 75 into hexadecimal.

Example 1

Convert the decimal number 7510 to hexadecimal.

Step 1: Divide 75 by 16.

75÷16=4 with a remainder of 11

Our quotient is 4 and our remainder is 11. Remember, a remainder of 11 in hexadecimal is the letter 'B'. So, our first hexadecimal digit is B.

Step 2: Take the quotient from the last step, which is 4, and divide it by 16.

4÷16=0 with a remainder of 4

Our new quotient is 0, which means we are done! The remainder is 4. Our second hexadecimal digit is 4.

Step 3: Read the remainders from the bottom up. The last remainder we found was 4, and the first one was 11 (which is B).

Reading upwards, we get: 4, then B.

So, 75 in decimal is 4B in hexadecimal.

7510=4B16

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.

Example 2

Convert the decimal number 48310 to hexadecimal.

Step 1: Divide 483 by 16.

483÷16=30 with a remainder of 3

The remainder is 3. We write this down.

Step 2: Take the quotient, 30, and divide it by 16.

30÷16=1 with a remainder of 14

The remainder is 14. Looking at our chart, we know that 14 is represented by the letter 'E' in hexadecimal. We write down E.

Step 3: Take the new quotient, 1, and divide it by 16.

1÷16=0 with a remainder of 1

The remainder is 1. The quotient is now 0, so we can stop dividing.

Step 4: Assemble the hexadecimal number by reading the remainders from the bottom to the top. The remainders we found were, in order: 3, 14 (E), and 1. Reading them in reverse order gives us 1, then E, then 3.

Therefore, 483 in decimal is 1E3 in hexadecimal.

48310=1E316
Key formulas for decimal to hexadecimal by Algebra911.
Key formulas for decimal to hexadecimal by Algebra911.

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!

Example 3

Convert the decimal number 270010 to hexadecimal.

Step 1: Divide 2700 by 16.

2700÷16=168 with a remainder of 12

A remainder of 12 is the letter C in hexadecimal.

Step 2: Take the quotient, 168, and divide it by 16.

168÷16=10 with a remainder of 8

The remainder is 8.

Step 3: Take the new quotient, 10, and divide it by 16.

10÷16=0 with a remainder of 10

A remainder of 10 is the letter A in hexadecimal. The quotient is 0, so we are finished with our divisions.

Step 4: Read the remainders from bottom to top. Our remainders, in the order we found them, were 12 (C), 8, and 10 (A). Reading them upwards gives us A, then 8, then C.

So, 2700 in decimal is A8C in hexadecimal.

270010=A8C16

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 10,11,12,13,14, or 15, 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., 75/16=4.6875) can help. To find the remainder from this, you can calculate 0.6875×16=11.
  • Stopping Too Early: Don't stop dividing until the quotient is zero. Even if you get a quotient like 1 or 5 (which is less than 16), you still need to do one last division step. For example, 5÷16 gives a quotient of 0 and a remainder of 5. That 5 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 10 through 15.

Conversion Steps:

  1. Take the decimal number and divide it by 16.
  2. Write down the remainder. Convert it to a letter (A-F) if it's 10 or greater.
  3. Take the whole number quotient from the previous step and divide it by 16 again.
  4. Repeat until the quotient is 0.
  5. Write the list of remainders in reverse order (from bottom to top).

Hexadecimal Digit Reference:

Decimal ValueHexadecimal Digit
10A
11B
12C
13D
14E
15F

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, 6+10=16, which tells you that it is a base-16 number system.

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 A8C16, or more commonly in programming, they put '0x' in front of the number, like 0xA8C.

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.