KS3 · Computer Science
Hexadecimal numbers
Which would you rather copy out without a slip: 11111111 10000000 00000000, or FF8000? They're the same three bytes. The short one is hexadecimal, and by the end of this lesson you'll be able to turn one into the other by hand.
Computer Science · Data representation
Four bits, sixteen patterns
Start with only the four bits on the right. Switch them on until all four are 1: 1111 is 8 + 4 + 2 + 1 = 15. 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. (The 0x in front of the Hex readout is just a label that says '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 are 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
- Hex has sixteen digits: 0 to 9, then A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
- In two-digit hex the left digit counts sixteens and the right digit counts ones.
- One hex digit = four bits (a nibble); two hex digits = one byte, 00 to FF.
- Computers store binary, never hex. Hex is a shorthand for people.
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.
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
- Abstraction in computational thinking
- Adding binary numbers
- Binary to denary conversion
- Boolean logic: AND, OR, NOT
- Bubble sort
- Building truth tables
- Client-server vs peer-to-peer
- Collecting and recording data
- Comparing sorting algorithms
- Compressing data
- Creating a 3D animation
- Decomposition: splitting problems up
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 1 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.