In
Search for math and science topics
Sign
Up
Advanced Topics > Numbers in Other Bases
Base 16: Hexadecimal Numbers
Base 16 uses powers of 16. The possible digits are 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E, and F. Some computers use hexadecimal for certain
things, like color codes!
Explanations (5)
Alex Federspiel
14
Text
Hexadecimal
Hexadecimal is regarded as base-16. Each place value in the number is some power of 16.
The hexadecimal values are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
The letters A through F represent 10 through 15, respectively.
From Decimal to Hexadecimal
Get ready, this method can be a pain to use. Just like with ternary, we want to focus on
the remainder.
Let's work through an example to see how it's done. Let's convert 42 to hexadecimal.
The first step is to divide our number by 16, taking the remainder.
Send Feedback
Log
In this.
We get a remainder of 10. Remember that hexadecimal uses the letter A to represent
Search for math
So the "ones place" of our hexadecimal and is
number science
A.
topics
Sign
Up
Next, we take the non remainder portion, 2, and divide it again by 16.
We get 0 as our non remainder part so we know we're done. The remainder is 2 so this will
be the "tens place" of our hexadecimal number.
4210 = 2A16
From Hexadecimal to Decimal
Just like with binary and ternary, to get to decimal you want to take the sum of each digit
multiplied by the powers of the base you're in. Since we're in base-16, we multiply by
powers of 16.
Let's convert 1C2 to a decimal number. Starting with 2, multiply by 16 to the zero power,
then C gets multiplied by 16 to the first power, and 1 gets multiplied by 16 to the second
power. Remember that C represents the number 12.
1C2
2 1 0
= (1 ⋅ 16 ) + (C ⋅ 16 ) + (2 ⋅ 16 )
2 1 0
= (1 ⋅ 16 ) + (12 ⋅ 16 ) + (2 ⋅ 16 )
= (1 ⋅ 256) + (12 ⋅ 16) + (2 ⋅ 1)
= 256 + 192 + 2
= 450
So,
1C216 = 45010
Practice
Try some on your own!
What is 16210
in base-16? Send Feedback
Log
In
2A Search for math and science topics
Sign
Up
102
A2
B2
Show Solution Check
14
Report Share Like
Related Lessons
Base 2: Base 3: Computer Combinatorics: View All
Binary Ternary Science: What Are Related
Numbers Numbers Pseudocode Graphs? Lessons
Joshua Siktar
9
Text
How many numbers can be represented in Hexadecimal?
The standard way of writing numbers, base 10, is where we use the digits
0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. However, using base 16 gives us more digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F . Thus we'd think that if we limit the number of
digits we can use, we'd be able to make more numbers in base 16 than in base 10. This
intuition is actually helpful, as the claim I made is true.
If we only have 3 digits, we can make less numbers in base 10 than in base 16, because we
have more options for each digit. This is true no matter how many digits
SendweFeedback
allow
Log
ourselves to use. It lets us get more information out of fewer digits; that is, it takesIn
less
Search
writing or typing to represent fornumbers.
bigger math and science topics
Sign
Up
Now we can work to answer the question of how many different numbers we can make in
a given base if we limit the number of digits. We'll answer this question for base 10, and
then for base 16. We start with base 10 since it's more familiar to most people. For that we
turn to the following diagram to guide us:
Suppose the number of digits we are allowing is d. In the above picture we pick three
digits so d = 3. Then to count how many numbers we can make, we count how many
options there are for each digit, and multiply them together. To pick the first digit, we can
use 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9, giving 10 possible options. We allow 0 to be the first digit
because then we technically have a number with less than d digits, which is OK; we just
can't use more than d digits.
In the same way, we can pick one of these same digits for the second digit, and then again
for the third. This means we have 10 choices for each digit, and then multiply these
numbers together.
Send Feedback
10 × 10 × 10 = 1000
Log
In might
If we use no more than 3 digits, we can make 1000 different numbers in base 10. You
Search
realize these are the first 1000 wholefor math and
numbers: science topics
0, 1, 2, . . . , 999!
Sign
Up
How many numbers can we make in base 10 with no more than 5 digits?
1000
10000
100000
50
90000
Show Solution Check
9
Report Share Like
Victor Wang
V Text
5
The digits in hexadecimal (or base 16) start with 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (just like in base 10).
The remaining base-16 digits are A, B, C, D, E, F , corresponding in order to the remaining
base-10 numbers less than 16 (namely 10, 11, 12, 13, 14, 15).
5
Report Share Like
Send Feedback
Log
In
Katie Jergens Search for math and science topics
K Text
Sign 1
Up
Hexadecimal (aka base-16) numbers have 2 properties: 1. Each place numeral is in the set
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f }, with a − f representing the decimal values 10 − 15. 2.
Each place value is equivalent to (number × 16 place
).
To get the decimal equivalent add the place values.
E.g. The decimal equivalent of 9af 2 is:
3 2 1 0
= (9 × 16 ) + (10 × 16 ) + (15 × 16 ) + (2 × 16 )
= (9 × 4096) + (10 × 256) + (15 × 16) + (2 × 1)
= 36864 + 2560 + 240 + 2
= 39, 666
1
Report Share Like
Alex Federspiel
1
Video
(Video) Hexadecimal
by Carl Herold
Send Feedback
Log