GCSE · Computer Science · OCR · Spec J277

Binary representation of characters

There are no letters inside a computer, only 0s and 1s. So how does it know which letter is which?

Computer Science · Data representation

One row of bits, two readings

64 + 16 + 4 = 84

8-bit binary 01010100 = 84 in denary

Read as a number (denary)84
Flip the 32 bit. What changes?

Flip the bits and the readout shows the row as a number. Now read the same row as an ASCII character code, using these codes: 84 is capital T, 116 is lower-case t, 65 is capital A, 97 is lower-case a and 48 is the character 0. Whatever row you build, the bits are the same either way. Only the rules you read them with change. This row writes each 7-bit ASCII code with a 0 on the front, so keep the 128 bit at 0.

Computer Science · Work out a code

Count along from a letter you know

You know that lower-case a has the ASCII code 97, and the lower-case letters run in alphabetical order. Work out the code for lower-case e, then write that code in binary.

  1. Start from the anchor you know: lower-case a has the code 97.
  2. missing step
Which line is step 2?

Computer Science · How many codes?

Every extra bit doubles the codes

Build a 3-bit code one bit at a time. Choose a branch each time and see where you land.

Bit 1 → Bit 2 → Bit 3

  • Every bit is a two-way choice: 0 or 1.

2 × 2 × 2 = 8 different 3-bit codes, and the tree ends 8 times.

On Start: no bits chosen yet. 2 branches to choose from.

Count the ends as you go: 2, then 4, then 8. That is 2 to the power 1, 2 and 3. With n bits there are 2 to the power n codes. 7 bits give 128 (ASCII), 8 bits give 256 and 16 bits give 65536. The price is that every character then needs that many bits of storage.

Computer Science · ASCII and Unicode

Who can store it?

For each kind of character, tick every character set that includes it. Then check your diagram.

  • A ASCII
  • B Unicode
  1. A capital English letter
  2. A lower-case English letter
  3. A digit character
  4. A punctuation mark
  5. A control code
  6. A letter from another writing system
  7. An emoji

Computer Science · Text and character sets

What do you really think is stored?

You type a message and send it to a friend's computer. It travels as bits.

Which is closest to what you think is going on?
How sure are you?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

How a computer turns 0s and 1s into letters, digits and symbols.

What you need to know

  • Computers use binary, sequences of bits that are each 0 or 1, for all the data and instructions they process.
  • A binary sequence can stand for a number, a sound or a letter, as long as you know which one it is meant to be.
  • Have a goYour friend insists a row of bits is always a number and could never be a letter. Is your friend right?

    No. The bits can stand for a number, a sound or a letter, as long as it is identified which one it is meant to be.

    The bits carry no meaning of their own, so someone has to say what they represent.

  • A character is a single letter, digit, punctuation mark or other symbol.
  • A computer stores each character as a binary code: a unique pattern of bits that stands for it.
  • A character set is an agreed list of characters, with the binary code given to each one.
  • Text only displays correctly if the sender and the receiver use the same character set.
  • Have a goA text arrives and every letter looks wrong, although the bits were sent perfectly. What might be different about the receiving computer?

    It may be using a different character set from the sender.

    Different rules turn the same bits into different characters, so both ends must use the same set.

  • ASCII uses 7 bits per character, giving 128 codes. It covers English letters in upper and lower case, digits, punctuation marks and control codes.
  • ASCII codes run in order: A is 65, B is 66, C is 67, a is 97, the character 0 is 48. Count along for the rest.
  • Have a goCapital letters run in order and A is 65. Count along the alphabet to work out the code for capital E.

    69

    E is four letters after A (B, C, D, E), so 65 + 4 = 69. Adding 5 would count A itself as a step, but A is already 65.

  • With n bits there are 2 to the power n codes, so more bits per character means more characters, but more storage for each one.
  • Unicode uses more bits per character than ASCII, so it has far more codes: many languages, symbols and emojis. Its first 128 codes match ASCII.

The big picture

A computer stores each character as a binary code from an agreed character set, such as ASCII or Unicode. The same bits mean different things under different rules, and more bits per character gives more possible characters at the cost of more storage.

Key points

1A character is stored as a binary code from a character set: an agreed list of characters and their codes.
2The same bits can mean different things depending on the rules applied, so sender and receiver must use the same character set.
3ASCII uses 7 bits (128 codes) and its codes run in order, so you can count along from a known code.
4More bits per character means more possible characters but more storage for each one, as in Unicode, whose first 128 codes match ASCII.

Worked example

Problem

A computer holds the 8-bit pattern 01000100 and reads it as an ASCII character code. Which capital letter is it? You know that A is 65, B is 66 and C is 67.

⚠ Watch out

Starting from the wrong anchor. Capitals count on from A = 65, lower-case letters from a = 97 and digit characters from 0 = 48. Counting from 65 to find lower-case e gives 69, which is the code for capital E.

🧠

Memory hook

Bits are just switches. The character set is the rulebook that says which character a pattern of switches stands for.

✓

Check yourself

If the character 0 is 48, what is the ASCII code for the digit character 5? Then say why the sender and the receiver need the same character set.

Flashcards

(14)
What is a bit?
A binary digit: a single 0 or 1.
What can one binary sequence stand for?
A number, a sound or a letter, as long as it is identified what it represents.
What is a character?
A single letter, digit, punctuation mark or other symbol.
How does a computer store a character?
As a binary code: a unique pattern of bits that stands for that character.
What is a character set?
An agreed list of characters together with the binary code given to each one.
Why must the sender and receiver use the same character set?
The same bits can mean different things under different rules, so a different set would show different characters.
How many bits does ASCII use per character, and how many codes is that?
7 bits, which gives 128 codes.
What does ASCII cover?
English letters in upper and lower case, digits, punctuation marks and control codes.
Which three ASCII codes can you count on from?
Capital A is 65, lower-case a is 97 and the character 0 is 48. The others follow in order.
Which anchor do you count on from to find the code for lower-case g?
Lower-case a (97), because g is lower case. g is 6 letters on, so its code is 103.
In ASCII, which is lower-case t and which is capital T: 116 or 84?
Lower-case t is 116 (01110100). Capital T is 84 (01010100).
What does each extra bit do to the number of possible codes?
It doubles it. With n bits there are 2 to the power n codes.
What is the trade-off of using more bits per character?
More different characters can be represented, but each character needs more storage.
How are Unicode and ASCII related?
The codes for Unicode's first 128 characters are the same as ASCII, so ASCII text is still valid Unicode.

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 OCR GCSE Computer Science topics

See the full OCR Computer Science curriculum →

How this lesson was checked. This OCR GCSE Computer Science (specification J277)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 14 November 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.