GCSE · Computer Science · AQA · Spec 8525

Convert binary ↔ hexadecimal

Turning binary into hex needs no big sum, just a pencil line down the middle. By the end of this page, 1101 0110 → D6 will take you five seconds.

Computer Science · Binary and hex

Flip a bit. Which hex digit moves?

8-bit binary 00110101 = 53 in denary, 0x35 in hex

Decimal53Hex0x35
try 1010 on the right. What appears?

Start with the right-hand four bits: flip any of them and watch the Hex readout. Then try the left-hand four. Last of all, switch all eight bits on and see how far one byte goes.

Watch out: The 0x in front of the hex readout is a label that program code uses to say a number is in hex. It isn't part of the number: the starting byte, 0011 0101, is written 35 in hex, not 0x35.

Watch it done: binary to hex

Problem

Convert the byte 1011 1001 into hexadecimal.

Your turn

Now go backwards: hex to binary

Convert the hex number E3 into an 8-bit binary number.

  1. Work one hex digit at a time: E first, then 3.
  2. missing step
Which line is step 2?

Spot the slip

Which line loses the mark?

Convert the byte 1100 0111 into hexadecimal.

A student's answer — which line goes wrong?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Why a byte splits neatly in half, and how that turns binary into hex and back without a single long sum.

What you need to know

  • What a nibble is, and why one nibble matches exactly one hex digit
  • How to convert a byte from binary into hex
  • How to convert a two-digit hex number into 8-bit binary
  • The biggest value one byte can hold, in binary, hex and decimal

The big picture

One hex digit stands for exactly four bits, a group called a nibble, because four bits have 16 patterns and hex has 16 digits: 0 to 9, then A to F. Binary to hex: split the byte into two nibbles, find each one's value with 8, 4, 2, 1, and write each value as one hex digit, so 10 to 15 become A to F. Hex to binary: turn each digit into its own four bits, keeping zeros on the left. One byte runs from 0000 0000 up to 1111 1111, which is FF in hex and 255 in decimal.

Key points

1A nibble is a group of four bits. A byte is eight bits, so it splits into two nibbles.
2Four bits have 16 possible patterns, 0000 to 1111, and hex has 16 digits, 0 to 9 then A to F. So each nibble matches exactly one hex digit.
3The hex digits A to F stand for the values 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
4Binary to hex: split the byte into two nibbles, find each nibble's value using the place values 8, 4, 2, 1, then write each value as a single hex digit.
5Hex to binary: write each hex digit as its own four bits, then join them in the same order. Always write all four bits, so 3 is 0011, not 11.
6You never need the whole number in decimal to convert between binary and hex. Each nibble is converted on its own.
7The largest value one byte can hold is 1111 1111 in binary, which is FF in hex and 255 in decimal.

Worked example

Problem

A game stores a character's energy in one byte and shows it on screen in hex. (a) The screen shows 5D. Write the byte in binary. (b) After a power-up, the byte is 1010 0101. What does the screen show now?

⚠ Watch out

Writing a nibble's value as an ordinary number instead of one hex digit, so 1110 1000 becomes 148 instead of E8. The left nibble is worth 14, and 14 is the single hex digit E. Each nibble gives exactly one character.

🧠

Memory hook

Chop, count, letter. Chop the byte in half, count each half with 8-4-2-1, and turn 10 to 15 into A to F. Going back? Every digit gets four bits, zeros and all.

✓

Check yourself

Without finding the decimal value, write 0110 1101 in hex, and write 9A as 8-bit binary. Then convert each answer back: if you get what you started with, you're right.

Flashcards

(8)
What is a nibble?
A group of four bits. A byte is two nibbles.
Why does one hex digit match exactly four bits?
Four bits have 16 patterns (0000 to 1111) and hex has 16 digits (0 to F), so each pattern has exactly one digit.
What values do the hex digits A to F stand for?
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
What are the place values inside one nibble, from left to right?
8, 4, 2, 1. Each nibble gets its own set, even the left-hand one.
Binary to hex: what are the three moves?
Split the byte into two nibbles, find each nibble's value with 8-4-2-1, then write each value as one hex digit.
Hex to binary: what are the moves?
Write each hex digit as four bits, keeping zeros on the left, then join the nibbles in the same order as the digits.
What is the largest value one byte can hold?
1111 1111 in binary, FF in hex, 255 in decimal.
In a two-digit hex number, what does the left digit count?
Sixteens. The left nibble's place values, 128, 64, 32 and 16, are 8, 4, 2 and 1 lots of 16. The right digit counts ones.

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.