KS3 · Computer Science
Hexadecimal numbers
Copy one out with no slips: 11111111 10000000 00000000, or FF8000? Same three bytes. The short one is hexadecimal, and soon you'll convert between them by hand.
Computer Science · Data representation
Four bits, sixteen patterns
Start with just the four bits on the right. Switch them on until all four are 1: 1111 is 8 + 4 + 2 + 1 = 15. That's the ceiling. Every pattern from 0000 to 1111 is a different number, 0 to 15, so four bits give sixteen patterns in all. Now switch on the 16 bit and watch the Hex readout. Which digit moved? (The 0x in front of the Hex readout is just a label meaning 'this is hex'; the digits after it are the number.)
Computer Science · Number representation
Binary to hex: split into fours
Binary to hex: split the byte into groups of four bits, starting from the right, and swap each group for its hex digit. Hex to binary: do the reverse and write each hex digit as its four bits. Try the first button: 1011 is 11, which is B, and 0110 is 6, so 1011 0110 is B6. The other buttons are the three bytes of the web colour #FF8000, a bright orange. (This tool labels denary as Decimal; they're two names for ordinary base-10 numbers.)
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Binary's shorthand: one digit for every four bits.
What you need to know
- Hexadecimal (hex) is base 16: sixteen digits, 0 to 9 and then the letters A to F.
- The letters are just big digits: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
Have a goWhich single hex digit stands for denary 13?
D
Count on from A = 10: A, B, C, D is 10, 11, 12, 13. Starting the letters at 1 would land you on M, which isn't a hex digit at all.
- Four bits make exactly 16 patterns, 0000 to 1111 (0 to 15), so one hex digit covers four bits.
- A group of four bits is a nibble. A byte is two nibbles, so it takes two hex digits: 00 to FF.
- In two-digit hex, the left digit counts sixteens and the right digit counts ones.
Have a goYour mate is certain that hex 20 means twenty. How much is it really, in denary?
32
The left digit counts sixteens, not tens, so hex 20 is 2 sixteens and no ones: 32. Your mate is reading hex as if it were denary.
- Going from hex to denary? Multiply the left digit's value by 16, then add the right digit's value.
- Going from denary to hex? Divide by 16: the whole-number result is the left digit, the remainder is the right.
- Binary to hex: split into groups of four from the right, then swap each group for its hex digit.
Have a goTurn the binary byte 1001 1111 into hex before you peek.
9F
1001 is 9 and 1111 is 15, which is F. Writing 915 would squeeze the denary 15 into one hex place, where only a single digit fits.
- Hex back to binary is the reverse: write each hex digit as its four bits.
- Computers store and process only binary, never hex. Hex is a shorthand for people, for things like web colour codes.
The big picture
Hexadecimal (hex) is a base-16 number system with sixteen digits, 0 to 9 and then A to F for 10 to 15. Four bits have exactly sixteen patterns, so one hex digit stands for four bits (a nibble) and two digits stand for a byte, 00 to FF. In two-digit hex the left digit counts sixteens and the right digit counts ones. Computers still store everything in binary: hex is a shorter way for people to read and write it, used for things like web colour codes.
Key points
Worked example
Problem
Convert the binary byte 1110 0101 into hex, then into denary.
⚠ Watch out
Putting a two-digit denary number into one hex place. 200 ÷ 16 = 12 remainder 8, and the 12 must become the single digit C, so 200 is C8 in hex. Writing '128' mixes denary into a hex number and gives the wrong value. It looks tidy. It's wrong.
Memory hook
One hex digit, one nibble, four bits. Two hex digits, one byte. Hex is binary with a shorter name tag: the computer never sees it.
Check yourself
Without looking back: what is hex 4E in denary, and what is 1101 0010 in hex? (Answers: 4 × 16 + 14 = 78, and D2.)
Flashcards
(14)What is hexadecimal?
What are the hex digits A, B, C, D, E and F worth in denary?
In a two-digit hex number, what does each digit count?
What is the largest two-digit hex number, and its denary value?
What is a nibble, and how many values can it hold?
Why does one hex digit stand for exactly four bits?
How many hex digits does one byte need?
How do you convert two-digit hex to denary?
How do you convert denary (0 to 255) to hex?
What's the method for binary to hex?
How do you convert hex to binary?
Do computers store data in hex?
Why do people use hex instead of binary?
Where might you see hex being used?
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 postedMore KS3 Computer Science topics
How this lesson was checked. This KS3 Computer Sciencelesson 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.