GCSE · Computer Science · AQA · Spec 8525

Hexadecimal (base 16)

Read this aloud without losing your place: 1101011010110110. Now try D6B6. Same bits, same number, a quarter of the characters. That shorthand is hexadecimal.

Computer Science · Number bases

Eight bits, two hex digits

8-bit binary 11010110 = 214 in denary, 0xD6 in hex

Denary214Hex0xD6
tap a bit to flip it

Each square is one bit. Tap a bit to flip it between 0 and 1: the row of squares is the binary. The Denary readout shows the value in ordinary base 10, and the Hex readout shows the same value in hexadecimal. However you set the eight bits, the hex never needs more than two digits.

Watch out: The 0x in front of the hex readout is a label programmers use to say 'this number is hex'. It isn't part of the value: 0xD6 is the hex number D6.

Predict, then check

You've seen A to F turn up in the readout. Now count with them.

You're counting up in hexadecimal: …7, 8, 9. Which sequence carries on correctly?

Which base could it be?

One string, three possible bases

For each string, tick every number system it could be written in. A string only belongs to a base if every character in it is one of that base's digits.

  • A Binary (0 and 1)
  • B Denary (0 to 9)
  • C Hexadecimal (0 to 9, A to F)
  1. 101
  2. 29
  3. 3F
  4. 1G
  5. FACE
  6. 750

What's really inside?

Where does the hex actually live?

A byte in a computer's memory holds 11010110. A programmer looking at it on screen sees it written as D6.

Which is closest to what you think is going on inside the computer?
How sure are you?

Put it in writing

Explain it in your own words

Explain why people often write values in hexadecimal instead of binary, and state what this changes inside the computer. [3 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.

A shorter way for people to write binary, while the computer carries on with its 1s and 0s.

What you need to know

  • Hexadecimal (hex) is a base-16 number system: it has sixteen different digits.
  • The hex digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. The letters A to F stand for the values ten to fifteen.
  • People often use hex instead of binary because it is easier to read and interpret, and it uses fewer digits.
  • Computers use binary to represent all data and instructions. They only store and process binary: hex is a shorthand for humans, and the number of bits underneath stays the same.

The big picture

Hexadecimal (hex for short) is a base-16 number system, so it needs sixteen single digits: 0 to 9, then A, B, C, D, E and F for the values ten to fifteen. People use hex instead of binary because it is easier to read and interpret and it uses fewer digits: each hex digit stands in for four bits, so a whole byte is just two hex digits. The computer never uses hex, though. It stores and processes binary only, and writing a value in hex doesn't change the number of bits underneath.

Key points

1Four bits have exactly sixteen patterns (0000 to 1111), and hex has exactly sixteen digits, so one hex digit covers four bits and a byte is always two hex digits.
2Counting in hex goes …8, 9, A, B, C, D, E, F, 10. Hex 10 means sixteen, not ten.
3Hex stops at F. A string containing G, or any later letter, isn't a hex number.
4The same characters can be legal in several bases: 101 could be binary, denary or hex, so always check which base you're reading.
5Programmers often write 0x in front of hex, as in 0xD6. The 0x only labels the base; it isn't part of the value.

Worked example

Problem

A 32-bit value is shown on screen in binary: 11001010111111101011101010111110. (a) How many digits would the same value need if it were written in hexadecimal? (b) Would writing it in hexadecimal let the computer store it in fewer bits?

⚠ Watch out

Treating hex as denary with a few letters tacked on: carrying on to G after F, or reading hex 10 as ten. Hex stops at F, and after F the count rolls over to 10, which in hex means sixteen.

🧠

Memory hook

Hex is for Humans. Sixteen digits from 0 to F, four bits per hex digit, two hex digits per byte, and the computer never sees any of it.

✓

Check yourself

Your friend says: "There's no point learning hex, because the computer doesn't even use it." One half of that is true and the other half isn't. Which half is which, and why?

Flashcards

(9)
What number base is hexadecimal?
Base 16: it has sixteen different digits.
List the hexadecimal digits in order.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
What values do the hex digits A to F stand for?
Ten to fifteen: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
Give two reasons people use hex instead of binary.
Hex is easier for humans to read and interpret, and it uses fewer digits.
Does a computer store or process data in hex?
No. Computers use binary for all data and instructions; hex is only how people write it.
Does writing a value in hex make it take up less memory?
No. The value is stored as the same number of bits whichever way a person writes it.
How many hex digits does one byte need?
Two. Each hex digit covers four bits, and a byte is eight bits.
Counting in hex, what comes straight after F, and what does it mean?
10, which in hex means sixteen.
What does the 0x mean in 0xD6?
It's a label programmers use to show the number is hex. It isn't part of the value.

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 AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

How this lesson was checked. This AQA GCSE Computer Science (specification 8525)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 29 September 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.