GCSE · Computer Science · AQA · Spec 8525

Convert decimal ↔ hexadecimal

In hexadecimal, 10 means sixteen. Not ten: sixteen. By the end of this lesson that will feel obvious.

Decimal and hex, side by side

Watch hex count in 16s

8-bit binary 00001111 = 15 in denary, 0x0F in hex

Decimal15Hex0x0F
tap a switch to flip it

The switches are just a quick way to set a number, so keep your eyes on the two readouts. You start at 15, which is 0F in hex: the right-hand hex digit has reached F, as high as a digit goes. Now make 16 (switch everything off except the 16) and watch the hex jump to 10. Make 32. Make 47, then 48, and see 2F roll over to 30. Last of all, switch all eight on. The 0x in front of the hex readout is only a label that means 'this is hex'. It isn't part of the number, so 0x10 is written 10.

Worked example: hex to decimal

Problem

Convert hex B7 to decimal.

Your turn, the other way round

Decimal to hex: fill in the missing steps

Convert decimal 94 to hexadecimal.

  1. Hex has a 16s column and a 1s column, so the first question is: how many whole 16s fit into 94?
  2. missing step
Which line is step 2?

Be honest

What does a hex number really mean?

You're shown three hex numbers: 10, 40 and 3D.

Which is closest to what you think right now?
How sure are you?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Two columns, 16s and 1s: convert any whole number from 0 to 255, in either direction.

What you need to know

  • A two-digit hex number has a 16s column and a 1s column: the same idea as decimal's tens and ones, with 16 in place of 10.
  • Hex needs sixteen single digits: 0 to 9, then A to F for the values 10 to 15.
  • Two hex digits cover every whole number from 0 to 255. That's 256 different values, because 0 counts too, but the biggest is FF = 255 (binary 1111 1111).
  • Converting never changes the number itself, only the way it's written.

The big picture

A two-digit hexadecimal number has a 16s column and a 1s column, and it uses A to F for the values 10 to 15. To convert hex to decimal, multiply the left digit by 16 and add the right digit. To convert decimal to hex, find how many whole 16s fit (the left digit) and what's left over (the right digit). The biggest two-digit hex number is FF, which is 255.

Key points

1Hex to decimal: left digit × 16, then add the right digit.
2Decimal to hex: whole 16s give the left digit, the remainder gives the right digit.
3Any value from 10 to 15 is written as one letter, A to F.
4The maximum is FF = 15 × 16 + 15 = 255.

Worked example

Problem

Show that hex FF is 255 in decimal, and explain why no two-digit hex number can be bigger.

⚠ Watch out

Reading hex as if it were decimal: calling hex 10 'ten', or multiplying the left digit by 10. The left digit counts 16s, so hex 10 is 16 and hex 50 is 80.

🧠

Memory hook

Every two-digit hex number answers one question: 'How many 16s, and what's left over?' Read hex 10 as 'one sixteen, no ones' and you'll never call it ten again.

✓

Check yourself

Convert hex D3 to decimal. Then convert your answer back into hex. If you don't land on D3 again, one of your steps slipped, so find it.

Flashcards

(7)
In a two-digit hex number, what does each digit count?
The left digit counts 16s. The right digit counts 1s.
What values do the hex digits A to F stand for?
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
What is hex 10 in decimal?
16: one 16 and no 1s. It is not ten.
Hex to decimal: what's the method?
Turn any letter into its value, multiply the left digit by 16, then add the right digit.
Decimal to hex: what's the method?
The number of whole 16s that fit is the left digit. What's left over is the right digit. Write 10 to 15 as A to F.
What is the biggest two-digit hex number, and its decimal value?
FF, which is 255 in decimal.
Why is decimal 14 written as E in hex, and not 14?
Each hex column holds exactly one digit. Hex 14 would mean one 16 and four 1s, which is 20.

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.