GCSE · Computer Science · Edexcel · Spec 1CP2

Hexadecimal

#FF6600 is six characters on your screen. Underneath, the computer is still holding 24 bits. So who is hexadecimal actually for? Flip a few bits and find out.

Computer Science · Data

Flip the bits, read the hexadecimal

0 = 0

8-bit binary 00000000 = 0 in denary, 0x00 in hex

Denary0Hex0x00
click a bit to toggle it

Eight switches, eight bits. Start with the four on the right and flip them from 0000 all the way up to 1111, watching the Hex readout. Here's the thing: four bits make exactly 16 values, and 0 to 9 runs out at 9, so hexadecimal needs six more symbols. Now flip a bit on the left and watch a second hexadecimal digit appear.

Watch out: The readout puts 0x in front of the hexadecimal digits. That's just a label saying "this is hex". Read the digits after it.

Computer Science · Number representation

Swap each group of four for one digit

Pick A3 first. The binary splits into two groups of four: 1010 becomes A and 0011 becomes 3. Read it the other way too: A3 back to 1010 0011. Then pick 6B and 6C. Only the right-hand group changes, because 6C is just one more than 6B.

128
64
32
16
8
4
2
1
Decimal
163
Binary
1010 0011
Hexadecimal
0xA3
Watch out: Make your groups of four starting from the right-hand end of the binary number, not the left.

Hexadecimal to denary

Same method, your turn: convert 3D

You've seen that hexadecimal 2F is 2 × 16 + 15 = 47 in denary. Same method, new number: convert 3D. At each gap, pick the step that comes next.

  1. Split 3D into its two digits: 3 on the left and D on the right.
  2. missing step
Which line is step 2?

What is hexadecimal for?

What does hexadecimal do for the computer?

Writing FF is much quicker than writing 11111111. They name the same number.

Be honest: which of these is closest to what you think hexadecimal does for the computer?
How sure are you?

Have a go

Why write a colour as #FF6600?

A programmer writes a colour as #FF6600, a six-digit hexadecimal code, instead of the 24 binary digits it is stored as. Explain why. Then name one other place hexadecimal is used. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

What you need to know

  • Four bits can be arranged in exactly 16 different ways, from 0000 up to 1111.
  • Hexadecimal is base 16: digits 0 to 9, then A to F. Each place is 16 times the one to its right.
  • The letters are numbers: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
  • Have a goSam says: "E is the fifth letter, so E is worth 5." Sam sounds very sure. What is E really worth?

    14

    The letters aren't alphabet positions. They carry on from 9: A is 10, B is 11, C is 12, D is 13, so E is 14.

  • Counting carries on as normal: after 6B comes 6C, and hexadecimal 10 is 16 in denary.
  • Have a goKeep counting from 6C. What are the next two hexadecimal numbers?

    6D, then 6E

    Counting works as normal: the letter digits just carry on upwards, one at a time, before any carry is needed.

  • Every group of four binary digits becomes one hexadecimal digit, so 1111 (15) is F and hexadecimal is shorter.
  • Binary to hexadecimal: split into fours from the right, then swap each group for its digit. 1010 0011 is A3.
  • Have a goTry it before you look: write 1111 0000 in hexadecimal.

    F0

    1111 is 15, which is F, and 0000 is 0. Each group of four gets its own digit, even a group of zeros, so you can't just drop it.

  • Hexadecimal to denary: multiply each digit by its place value and add. 2F is 2 × 16 + 15 = 47.
  • People use hexadecimal because it's easier to read, write and interpret, and fewer digits means fewer errors.
  • It's for humans only: the computer still stores and processes binary, with the same number of bits.
  • You'll see hexadecimal in colour codes like #FF6600, in MAC addresses and in memory dumps.

The big picture

Hexadecimal is base 16: the digits 0 to 9, then A to F for 10 to 15. One hexadecimal digit stands for exactly four bits, so long binary becomes short and much easier for people to read, write and convert. The computer still stores and processes the same binary.

Key points

1Hexadecimal is base 16: digits 0 to 9 then A to F, where A to F are the values 10 to 15.
2One hexadecimal digit stands for four bits, so 1111 is 15, which is F.
3Binary to hexadecimal: groups of four from the right. Hexadecimal to denary: digit × place value, then add.
4Hexadecimal is easier for people to read, write and interpret, and fewer digits means fewer errors.
5Hexadecimal is for humans only: the computer still stores and processes the same binary bits.

Worked example

Problem

Convert the binary number 0111 1011 to hexadecimal, then convert that hexadecimal number to denary.

⚠ Watch out

Thinking hexadecimal saves memory or makes the computer faster. It looks convincing, because the number is shorter on screen. It does neither: the computer still stores and processes the same bits, and hexadecimal is only easier for people to read and write.

🧠

Memory hook

Four bits, sixteen values, one hexadecimal digit. The screen shows the short version; the computer still holds every bit.

✓

Check yourself

Invent a two-digit hexadecimal number with a letter in it. Write it in binary, then in denary. Then say what hexadecimal does for you, but not for the computer.

Flashcards

(13)
How many different values can four bits hold?
16, from 0000 (0) up to 1111 (15).
What are the 16 digits of hexadecimal, in order?
0 1 2 3 4 5 6 7 8 9 A B C D E F.
What do the letters A, B, C, D, E and F stand for?
A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
How much bigger is each hexadecimal place value than the one to its right?
16 times bigger, so the places are worth 1, 16 and so on.
What comes after 6B in hexadecimal? And what is hexadecimal 10 in denary?
6C, because counting carries on as normal. Hexadecimal 10 is 16 in denary, the first value that needs two digits.
Which hexadecimal digit is 1111?
F, because 1111 is 15 in denary.
How many binary digits does one hexadecimal digit stand for?
Four. Every group of four binary digits becomes one hexadecimal digit, so hexadecimal is shorter than binary.
How do you convert binary to hexadecimal?
Split into groups of four bits from the right, then swap each group for its hexadecimal digit. Reverse the steps to go from hexadecimal to binary.
Write hexadecimal 9E as binary.
9 is 1001 and E is 1110, so 9E is 1001 1110.
How do you convert hexadecimal to denary?
Multiply each digit by its place value (1, 16, …) and add the results. For example 2F is 2 × 16 + 15 = 47.
Why do people use hexadecimal instead of binary?
It is easier to read, write and interpret, and it uses fewer digits, so errors are less likely.
A colour code like #FF6600 has six characters. How many bits does the computer hold, and does hexadecimal save memory?
24 bits (six digits × four bits). Hexadecimal saves no memory and is no faster: the computer still stores and processes binary.
Name three places hexadecimal is seen.
Colour codes such as #FF6600, MAC addresses and memory dumps.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.