GCSE · Computer Science · AQA · Spec 8525

Convert binary ↔ decimal

Eight light switches, each with a number painted on it. Flick the right ones on and you can make any whole number from 0 to 255. That's binary.

Computer Science · Data representation

Binary place value

Each column is a switch with a value on top. Build 13 by switching on the columns that add up to it. Then switch all eight on and see how high you can go. (Decimal is also called denary.)

Challenge

Build the number 13

0
128+128
64+64
32+32
16+16
8+8
4+4
2+2
1+1
Denary total00000000

0

All bits are 0 — every column is switched off.

Decimal to binary

Convert 77 into 8-bit binary

Convert the decimal number 77 into an 8-bit binary number. Same method every time: start at the biggest place value and ask one question at every column. Does it fit into what's left?

  1. Write the eight place values as headings: 128, 64, 32, 16, 8, 4, 2, 1.Headings first, before any 0s or 1s. They are your map.
  2. missing step
Which line is step 2?

Binary to decimal

Find the line where it goes wrong

Convert the 8-bit binary number 1100 0101 into decimal.

A student's answer — which line goes wrong?

The biggest number

How high can eight bits go?

You have eight bits and you can switch on as many as you like.

What is the largest decimal number eight bits can hold? Pick the one closest to what you think.
How sure are you?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Every binary number is a row of switches. Learn which switches are worth what, and you can convert either way.

What you need to know

  • Binary uses just two digits, 0 and 1. Each digit is called a bit, and a row of bits can represent a whole number.
  • Every bit sits under a place value. A 1 switches that value on; a 0 leaves it off.
  • Across eight bits the place values are 128, 64, 32, 16, 8, 4, 2, 1. They double each step to the left.
  • So the rightmost bit is worth 1 and the leftmost is worth 128, just like decimal keeps its smallest column on the right.
  • Have a goYour mate Jay is certain that 0000 0001 is worth 128, "because the 1 is the eighth digit along". Is Jay right?

    No. 0000 0001 is worth 1.

    The 1 sits in the rightmost column, which is worth 1. Jay is counting how far along the digit is instead of reading the value of its column.

  • Binary to decimal? Add up the place values of the columns holding a 1. The 0 columns add nothing.
  • Have a goOnly the 16 column and the 2 column are switched on. What decimal number is that?

    18

    16 + 2 = 18. Every other column holds a 0, so it adds nothing; it's not 2, which would just count how many bits are on.

  • Decimal to binary? Work from 128 down to 1. If the value fits into what's left, write 1 and subtract. If not, write 0.
  • Have a goRun the method on 40. Which columns get a 1?

    The 32 and 8 columns: 0010 1000.

    128 and 64 don't fit into 40. 32 fits, leaving 8, and 8 fits exactly, leaving 0. Grabbing 64 because it's 'nearest' skips the fits-into test.

  • Finished a decimal-to-binary answer? Add its place values back up. You should land exactly on the number you started with.
  • Asked for 8 bits? Write all eight digits, zeros at the front included.
  • Eight bits can represent every whole number from 0 to 255. The largest, 1111 1111 in binary, is 255 in decimal.

The big picture

Binary writes whole numbers using only 0s and 1s. Each position has a place value, and the values double as you move left: 1, 2, 4, 8, 16, 32, 64, 128 across eight bits. A 1 switches that value on and a 0 leaves it off. Binary to decimal: add up the values that are on. Decimal to binary: work down from 128, writing 1 and subtracting wherever the value fits into what's left, and 0 wherever it doesn't. Eight bits hold every whole number from 0 to 255, and the largest, 1111 1111, is 255.

Key points

1A 1 means that place value is switched on. A 0 means it's off. The number is the sum of the ones that are on.
2Write the place-value headings before you touch the bits, 128 on the left and 1 on the right. Writing them backwards is the slip that turns a right method into a wrong answer.
3When a question asks for 8 bits, write all eight digits, front zeros included: 77 is 0100 1101. Otherwise the front zeros are optional. They add nothing, so 100 1101 is 77 too.
4Check a decimal-to-binary answer by adding its place values back up. You should land exactly on the number you started with.
5There are 256 patterns of eight bits, but they run from 0 to 255 because one pattern is 0000 0000.

Worked example

Problem

Convert the 8-bit binary number 1010 0110 into decimal.

⚠ Watch out

Writing the place values backwards, 1 on the left. You read left to right, so it feels natural. But the smallest value sits on the right, like the ones column in ordinary numbers. Get the headings backwards and every bit gets the wrong value, even when the adding is perfect.

🧠

Memory hook

Double as you go left: 1, 2, 4, 8, 16, 32, 64, 128. Add the ones that are on. All eight on is 255, never 256, because 0 takes a pattern too.

✓

Check yourself

Quick check: what is 0011 1000 in decimal, and what is 200 in 8-bit binary? (56, since 32 + 16 + 8 = 56. And 1100 1000, since 128 + 64 + 8 = 200.)

Flashcards

(7)
What are the place values of an 8-bit binary number, from left to right?
128, 64, 32, 16, 8, 4, 2, 1. They double every step to the left.
Which bit is worth the most, and which is worth the least?
The leftmost bit is worth the most (128). The rightmost bit is worth the least (1).
How do you turn a binary number into decimal?
Add up the place values of every column that holds a 1. Columns holding 0 add nothing.
How do you turn a decimal number into binary?
Go from 128 down to 1. If the place value fits into what's left, write 1 and subtract it. If it doesn't fit, write 0.
What is the largest number eight bits can hold, in binary and in decimal?
1111 1111 in binary, which is 255 in decimal.
Eight bits make 256 different patterns. Why is the largest value 255 and not 256?
One of the 256 patterns is 0000 0000, which is 0. So the patterns cover 0 to 255.
Why does an 8-bit answer keep its zeros at the front?
An 8-bit number has a digit in all eight columns, so a 0 in the 128 column is still written, e.g. 0100 1101.

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 25 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.