Hexadecimal To Decimal

Download as PDF

Have you ever seen numbers that use letters like 'A' or 'F'? Welcome to the world of hexadecimal! This lesson will show you the simple and fun way to translate these special 'hex' numbers into the regular decimal numbers you use every day. It's like learning a secret code for computers!

Hexadecimal To Decimal — an original Algebra911 reference diagram defining hexadecimal to decimal with its key formula and a worked example.
How to Convert Hexadecimal to Decimal Numbers

What Is the Hexadecimal Number System?

The hexadecimal number system is a way of counting that uses a base of sixteen, which means it has sixteen unique symbols to represent numbers. Our everyday number system, called decimal or base-10, uses ten symbols: a ten-digit system with digits from 0 to 9. Hexadecimal, often shortened to just 'hex', uses the same ten digits (0,1,2,3,4,5,6,7,8,9) but adds six letters to represent the values from ten to fifteen: A, B, C, D, E, and F.

So, why add letters? In a base-10 system, once you count past 9, you add another digit to the left to make 10. You're using two symbols ('1' and '0') to represent the number ten. In hexadecimal, you need a single symbol for every value up to fifteen. Since we run out of number digits after 9, we use letters. Here’s what they stand for:

  • A represents the value 10
  • B represents the value 11
  • C represents the value 12
  • D represents the value 13
  • E represents the value 14
  • F represents the value 15

This might seem strange at first, but it's incredibly useful, especially for people who work with computers. To help you see the pattern, here is a table comparing the first sixteen numbers in decimal, hexadecimal, and binary (base-2), which computers use directly.

Decimal (Base-10)Hexadecimal (Base-16)Binary (Base-2)
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111

After F (fifteen), hexadecimal works just like decimal: you add a digit to the left. So, the number after F is 10. But be careful! In hex, '10' doesn't mean ten. It means one group of sixteen and zero ones, which is sixteen in decimal!

Why Do People Use Hexadecimal Numbers?

You might be wondering why we need another number system when our regular decimal system works just fine. The main reason is that hexadecimal is a much more human-friendly way to represent the numbers that computers use. Computers don't think in base-10; they think in binary (base-2), which is a system with only two digits: 0 and 1.

A long string of binary numbers like 1101010110101111 is very hard for a person to read and remember without making mistakes. Hexadecimal helps solve this problem. Each hexadecimal digit corresponds perfectly to a group of exactly four binary digits. For example, the hex digit D is 13 in decimal, which is 1101 in binary. The hex digit F is 15 in decimal, which is 1111 in binary. So, that long binary string 1101010110101111 can be shortened to the hex number D5AF. Much easier to read!

You see hexadecimal used in many digital places:

  • Web Colors: Have you ever seen a color code like #FF0000? That's a hexadecimal number! It tells the computer how much red, green, and blue to mix to make a specific color. #FF0000 is pure red.
  • Error Messages: Sometimes, when a computer program crashes, it will show an error code with hex numbers to help programmers figure out what went wrong.
  • Memory Addresses: Every piece of information in a computer's memory has an address, like a house number on a street. These addresses are often shown in hexadecimal because they can get very long.

So, while you won't use hex to buy groceries, it's a fundamental language for programming, web design, and understanding how digital technology works.

How Does Place Value Work in Hexadecimal?

Understanding place value is the key to converting numbers between any base. Let's quickly review how it works in our familiar decimal (base-10) system. When you see a number like 352, you instinctively know it means 3 hundreds, 5 tens, and 2 ones. Each place represents a power of ten.

Starting from the right:

  • The first spot is the ones place: 100=1
  • The second spot is the tens place: 101=10
  • The third spot is the hundreds place: 102=100

So, 352=(3×100)+(5×10)+(2×1).

Hexadecimal (base-16) works exactly the same way, but instead of powers of ten, we use powers of sixteen. The place values increase by a factor of 16 as you move from right to left.

Starting from the right:

  • The first spot is the ones place: 160=1
  • The second spot is the sixteens place: 161=16
  • The third spot is the two-hundred-fifty-sixes place: 162=256
  • The fourth spot is the four-thousand-ninety-sixes place: 163=4096

Let's look at a hex number like 3B4. The 'B' might look strange, but remember it's just the symbol for the value eleven. To find its decimal value, we use the hexadecimal place values:

The hex number 3B4 has digits:

3B4

Their place values are:

( )162=256( )161=16( )160=1

So, the number 3B4 represents 3 groups of 256, B (which is 11) groups of 16, and 4 groups of 1. By mastering this concept of base-16 place value, any conversion becomes a simple multiplication and addition problem.

What Is the Step-by-Step Method for Conversion?

Converting a hexadecimal number to its decimal equivalent is a straightforward process once you understand place value. You can follow these simple steps every time to get the correct answer. We'll use the hexadecimal number 1A5 as our example as we go through the steps.

  1. Write Down the Hexadecimal Number:
    First, just write the number you want to convert. Let's use 1A5.
  2. Assign Place Values:
    Starting from the rightmost digit, assign the correct power of 16 to each place. The rightmost digit is always 160, the next one to the left is 161, the next is 162, and so on.
    For 1A5:
    The 5 is in the 160 (or ones) place.
    The A is in the 161 (or sixteens) place.
    The 1 is in the 162 (or 256s) place.
  3. Convert Letters to Decimal Values:
    Look at your hex number. If you see any letters (A-F), convert them to their decimal number equivalents (10-15).
    In 1A5, the digit A is equal to 10 in decimal. The other digits, 1 and 5, are the same in both systems.
  4. Multiply Each Digit by Its Place Value:
    Now, take the decimal value of each digit and multiply it by its corresponding place value.
    For 1A5:
    Digit 1: 1×162=1×256=256
    Digit A (which is 10): 10×161=10×16=160
    Digit 5: 5×160=5×1=5
  5. Add the Results Together:
    The final step is to add up all the values you calculated in the previous step. This sum is the final decimal number.
    For 1A5: 256+160+5=421.

So, the hexadecimal number 1A5 is equal to the decimal number 421. That's all there is to it! You can use this five-step method to convert any hexadecimal number, no matter how long it is.

Let's Work Through Some Examples

Practice makes perfect! Let's walk through a few more examples together, from simple to a bit more challenging. Seeing the method in action is the best way to learn.

Decimal Value = (digit×16place)
Example 1

Convert the hexadecimal number 8C to decimal.

Step 1 & 2: Identify Digits and Place Values
The number is 8C.
The digit C is in the ones place (160).
The digit 8 is in the sixteens place (161).

Step 3: Convert Letters to Numbers
The digit C is equivalent to 12 in decimal.

Step 4: Multiply Digits by Place Values
For the digit 8: 8×161=8×16=128
For the digit C (or 12): 12×160=12×1=12

Step 5: Add the Results
128+12=140
So, the hexadecimal number 8C is equal to 140 in decimal.

Example 2

Convert the hexadecimal number 40E to decimal.

Step 1 & 2: Identify Digits and Place Values
The number is 40E.
The digit E is in the 160 place.
The digit 0 is in the 161 place.
The digit 4 is in the 162 place.

Step 3: Convert Letters to Numbers
The digit E is equivalent to 14 in decimal.

Step 4: Multiply Digits by Place Values
For the digit 4: 4×162=4×256=1024
For the digit 0: 0×161=0×16=0
For the digit E (or 14): 14×160=14×1=14

Step 5: Add the Results
1024+0+14=1038
So, the hexadecimal number 40E is equal to 1038 in decimal.

Example 3

Convert the hexadecimal number BEEF to decimal. (Yes, you can spell words with hex!)

Step 1 & 2: Identify Digits and Place Values
The number is BEEF. This is a four-digit hex number.
The rightmost F is in the 160 place.
The E is in the 161 place.
The next E is in the 162 place.
The B is in the 163 place.

Step 3: Convert Letters to Numbers
The digit B is equivalent to 11.
The digit E is equivalent to 14.
The digit F is equivalent to 15.

Step 4: Multiply Digits by Place Values
For the digit B (11): 11×163=11×4096=45056
For the first E (14): 14×162=14×256=3584
For the second E (14): 14×161=14×16=224
For the digit F (15): 15×160=15×1=15

Step 5: Add the Results
45056+3584+224+15=48879
So, the hexadecimal number BEEF is equal to the very large decimal number 48,879.

What Are Some Common Mistakes to Avoid?

When you're first learning to convert from hexadecimal to decimal, it's easy to make a few common mistakes. Being aware of these pitfalls can help you avoid them and improve your accuracy.

  • Forgetting the Letters are Numbers: The most common error is seeing a letter like 'C' and not knowing what to do with it. Always remember to convert A, B, C, D, E, F to their decimal values 10, 11, 12, 13, 14, 15 before you start multiplying.
  • Mixing up Place Values: Sometimes students accidentally use powers of 10 instead of powers of 16. Remember, in hexadecimal, every place value is 16 times bigger than the one to its right. It's the 1s, 16s, 256s place, not the 1s, 10s, 100s place.
  • Starting Place Values from the Left: Place value always starts from the right. The rightmost digit is always in the 160 (ones) place. Don't start counting powers from the left side of the number.
  • Calculation Errors: The multiplication and addition can sometimes involve large numbers. Take your time and double-check your math, or use a calculator to check your final answer once you've written out all the steps. The goal is to learn the process, not just get the number.
  • Confusing 160 and 161: A key math rule is that any number raised to the power of 0 is 1 (so 160=1). And any number to the power of 1 is just itself (so 161=16). Don't mix these two up!

By keeping these points in mind, you'll find the conversion process much smoother and more reliable.

Quick Summary and Reference

Here is a quick summary of the key information you need to convert hexadecimal numbers to decimal. You can use this as a quick reference guide when practicing.

The Core Idea:
To convert a hexadecimal number to decimal, you multiply each hex digit by its place value (which is a power of 16) and then add all those products together.

The Steps:

  1. Identify the place value for each digit, starting with 160 on the right.
  2. Change any letter digits (A-F) to their decimal number values (10-15).
  3. Multiply each digit's value by its place value.
  4. Add all the results to get the final decimal number.

Hexadecimal Digit Reference Chart:

Hex DigitDecimal Value
A10
B11
C12
D13
E14
F15

Place Value Chart (Powers of 16):

Position (from right)Power of 16Decimal Value
1st1601
2nd16116
3rd162256
4th1634,096
5th16465,536

Frequently Asked Questions

What does the word 'hexadecimal' actually mean?

The word 'hexadecimal' is a combination of 'hexa' (from the Greek word for six) and 'decimal' (from the Latin word for ten). So, it literally means 'six plus ten', which adds up to the 16 that is the base of this number system.

Why does hexadecimal use letters instead of just more numbers?

A number system needs a single, unique symbol for each value up to its base. Since our familiar number symbols only go up to 9, we need six more symbols to represent the values 10, 11, 12, 13, 14, and 15. Using the letters A through F was the simplest and most widely adopted solution.

Can you convert from decimal back to hexadecimal?

Yes, you absolutely can! The process is different—it involves repeated division by 16 and keeping track of the remainders. It's like doing the conversion process in reverse to find out how many groups of 16, 256, etc., fit into your decimal number.

Where will I see hexadecimal numbers in real life?

The most common place is in anything related to computers and digital technology. You'll see them in web design for color codes (like #34A853), in Wi-Fi passwords, in computer error messages, and in programming to manage memory locations.

What is the biggest single digit in hexadecimal?

The biggest single digit in hexadecimal is F. It represents the decimal value of 15. After F, you need two digits to represent the next number, which is 10 in hex (meaning one sixteen and zero ones).

Is it possible to do math like addition or subtraction with hex numbers?

Yes, it is. You can add, subtract, multiply, and divide hexadecimal numbers directly without converting them to decimal first. It follows similar rules to decimal math, but you have to remember to 'carry over' when you reach 16, not 10.

Why is it important to learn about different number bases?

Learning about systems like hexadecimal and binary helps you understand how computers 'think' at a fundamental level. It's a key concept in computer science and digital logic, and it also strengthens your overall understanding of the math behind our own decimal number system.

Is a hex number like '9A' bigger than a decimal number like '99'?

Yes, it is. The hex number 9A is equal to (9×16)+(10×1), which is 144+10=154 in decimal. So, 9A in hex is much larger than 99 in decimal.