DoingMaths - Free maths worksheets
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • How to Find the Average of a Group of Numbers
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to Draw Pie Charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
        • How to Find the Lowest Common Multiple and Highest Common Factor of Two Numbers
        • How to Write a Number as a Product of Its Prime Factors
        • How to Solve a Quadratic Equation: 3 Methods
        • How To Solve the GCSE Maths Question That's Leaving Parents Stumped
        • How to Multiply Decimal Numbers Without a Calculator
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
      • Every Prime Number Larger Than 3 Is 1 Away From a Multiple of 6: A Proof
      • Why Do Buses Come in Threes?
      • A Quick Way to Solve 1000^2 − 999^2: The Difference of Two Squares
      • What Are Triangular Numbers?
      • What Is the Collatz Conjecture?
      • How to Make a Mathematical Paper Snowflake
      • What Is the Unexpected Hanging Paradox?
      • What Is Pi?
      • Is There a Biggest Prime Number or Do They Continue Infinitely?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy

What Are Hexadecimal Numbers?

249 in Hexadecimal and Decimal
249 in Hexadecimal and Decimal

What Are Hexadecimal Numbers?

The hexadecimal number system (often known simply as 'Hex') is a base-16 system of counting used commonly in computing. Whereas our normal decimal system of counting works in base 10, using the ten different digits 0-9, hexadecimal's base-16 means it uses sixteen digits; 0-9 and the letters A-F.
To understand this further, let's look at some examples.

Building Decimal and Hexadecimal Numbers​

Both decimal and hexadecimal start in the same way: 0, 1, 2, 3, ... , 9. Once the decimal has reached 9, it has run out of digits, so we start another column on the left with a 1 and reset the original column to zero to get 10. We then keep on counting 11, 12, 13, etc., until we reach 19 and again reset our righthand column and add one to the left to get 20. Each time a column runs out of digits, we reset it to zero and add one to the column to the left, e.g., 99 to 100, 799 to 800, etc.
Hexadecimal, however, has extra digits A - F to continue through before extra columns are needed. We, therefore, start 0, 1, 2, ..., 8, 9, A, B, C, D, E, and F, where the letters A - F are equivalent to the decimal numbers 10 - 15. Once we reach F, we reset the column and start a new column to the left as in decimal. This next number is written 10. We then continue 10, 11, 12, ... ,19, 1A, 1B, ... , 1F, 20 etc. Each time a column reaches F, we reset it and increase the column to its left.
Decimal's ten digits mean that each column is worth 10 times the column to its right, e.g., tens = 10 × units, hundreds = 10 × tens and so on.
In hexadecimal with its sixteen digits, however, each column is worth 16 times the previous. Therefore, our first column counts ones, the second column counts 16s, the third column counts 162s (or 256s), and so on.
The columns in a hexadecimal number
The columns in a hexadecimal number

Converting Between Decimal and Hexadecimal

To convert from hexadecimal to decimal relies upon counting in powers of 16. For example, take the hexadecimal number 3B2. As B is the 11th number in hexadecimal, this converts to 3×16^2+11×16+2×1 = 946.
Similarly, the number EA17 = 14×16^3 + 10×16^2 + 1×16 + 7×1 = 59 927.
Converting from decimal to hexadecimal is a little trickier but achievable with some division. First, work out what the highest power of 16 which will go into your number is. E.g., to convert 1782, we see that 1782>16^2 but <16^3, so we will divide by 16^2 to see how many times this fits and what remainder is left.
1782÷16^2 = 6.96 ... or 6 remainder 246, so our hexadecimal number starts with a 6. We then divide the remainder by 16, so 246÷16 = 15.375 or 15 remainder 6. This gives us F as our middle digit (as F = 15) and 6 as our last digit, so 1782 = 6F6.

The First 18 Numbers in Decimal and Hexadecimal

Decimal
Hexadecimal
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
17
11
18
12

Some Uses of the Hexadecimal Number System

We've looked at what the hexadecimal system is, but what is its purpose? As mentioned earlier, its main use is in computing. Computers run on a binary number system of 1s and 0s (read my article on binary numbers to find out more about how this works). This is great for a computer where 0s and 1s are matched to switches being off or on but is difficult to write accurately as numbers that are quite small in decimal can have many digits in binary. e.g., 98 = 11000 in binary.
This is where hexadecimal comes in useful. As 16 = 2^4, one hexadecimal digit is equal to four binary digits e.g. 9 = 0101 and F = 1111. We can therefore write binary numbers in the hexadecimal system by grouping our binary digits into groups of four bits, which are known as 'nibbles'.
For example, the binary number 1101 0011 1010 1001 would become D3A9, which is much easier to read and write without fear of making an error.
Another advantage of hexadecimal is that it can express numbers in fewer digits than decimal, with each place representing one out of a possible sixteen rather than ten, hence uses less memory.

Using Hexadecimal for Colour Coding

One of the places you are most likely to have seen hexadecimal numbers while using a computer is in picking colours. When choosing colours on a computer, you generally have the choice between several systems such as hexadecimal, RGB, etc. The decimal RGB system gives the amounts of red, green and blue used in your colour out of a total of 255, so for example, pure red = (255, 0, 0), pure green = (0 255, 0) and pure blue = (0, 0, 255). Mixing these gives different colours, such as (255, 255, 0) for yellow.
We can rewrite these colours by converting each number into hexadecimal and writing it as a six digit number preceded by #. For example, black = (0, 0, 0) = #000000 while red = (255, 0, 0) = #FF0000. (209, 136, 210) gives a shade of pink which can be written as #D188D2 as 209 = D1, etc.

Comments

Have you used hexadecimal before? Does it make sense to you? Don't forget to leave your comments below.
Home      Algebra      Shapes, space and measures      Number      Data handling      Starters      Internet articles      DoingMaths Youtube channel
© Copyright DoingMaths free worksheets 2026 - All Rights Reserved
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • How to Find the Average of a Group of Numbers
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to Draw Pie Charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
        • How to Find the Lowest Common Multiple and Highest Common Factor of Two Numbers
        • How to Write a Number as a Product of Its Prime Factors
        • How to Solve a Quadratic Equation: 3 Methods
        • How To Solve the GCSE Maths Question That's Leaving Parents Stumped
        • How to Multiply Decimal Numbers Without a Calculator
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
      • Every Prime Number Larger Than 3 Is 1 Away From a Multiple of 6: A Proof
      • Why Do Buses Come in Threes?
      • A Quick Way to Solve 1000^2 − 999^2: The Difference of Two Squares
      • What Are Triangular Numbers?
      • What Is the Collatz Conjecture?
      • How to Make a Mathematical Paper Snowflake
      • What Is the Unexpected Hanging Paradox?
      • What Is Pi?
      • Is There a Biggest Prime Number or Do They Continue Infinitely?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy