GCSE · Computer Science · OCR · Spec J277

Character set

A computer only stores 0s and 1s. So how does it know one pattern is a Q and another is a smiley? Somebody had to agree the matching.

Computer Science · Character sets

Flip the bits, count the codes

0 = 0

7-bit binary 0000000 = 0 in denary

This pattern as a number0
Try it: use only the right-hand bit and count the different numbers you can make. Then use the right-hand two bits, then three. What happens each time you add a bit?

Seven bits can make 128 different patterns: every number from 0 to 127 is a different one. A character set matches each character to one pattern, so the number of patterns is the most characters it can code.

Who can code what?

Sort the characters

Which of these characters does each character set have a code for? Tick every set an item belongs to, or 'In none'.

  • A ASCII
  • B Unicode
  1. A capital English letter, such as Q
  2. A lower case English letter, such as q
  3. A digit, such as 7
  4. A punctuation mark, such as a comma
  5. The space between two words
  6. Enter and tab (control characters)
  7. A letter from the Urdu alphabet
  8. An emoji

ASCII and Unicode side by side

ASCIIvsUnicode

Open each insight to see what the difference tells you.

Focus

When it was first used

ASCII

1963 (first created and used)

Unicode

1991

The insight

A later date does not mean ASCII was thrown away. Unicode's first 128 characters are the same as ASCII's.

Bits per character

ASCII

A seven-bit binary sequence for each character

Unicode

Up to 32 bits (four bytes) per character

How many characters

ASCII

128 possible characters

Unicode

Far more than ASCII

Languages and symbols

ASCII

Western (basic English) alphabets only, so no Urdu and no emojis

Unicode

A far wider range of languages and symbols, including emojis

How the two relate

ASCII

Its characters are the same as the first 128 in Unicode

Unicode

Its first 128 characters are the same as ASCII's, so it can display ASCII text correctly

Predict, then check

In ASCII the letters and their sequences go in order. Now look closer at one letter in its two forms.

In ASCII, capital 'G' and lower case 'g' are different characters, so each has its own seven-bit sequence. Put the two sequences side by side. How many of the seven bits differ?

Ideas to test

Which idea is closest to yours?

Two students are comparing notes on how computers handle text.

Which of these is closest to what you think right now?
How sure are you?

Your turn to write

Explain it in your own words

Explain why computers must use the same character set when text is sent in an email, and why Unicode can represent more characters than ASCII. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

UK note

OCR GCSE Computer Science (J277): character sets, ASCII and Unicode are covered in specification section 1.2.4 Data storage.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

How a computer turns text into 0s and 1s, and why the length of the pattern decides how many characters it can handle.

What you need to know

  • A character set matches each character to a unique binary sequence, so a computer can store and process text as binary.
  • n bits give 2 to the power of n states, so each extra bit doubles the number of states.
  • Have a goA friend says each extra bit only adds one more state. Test it: one bit has two states, 0 and 1. List every state of two bits.

    00, 01, 10 and 11: four states.

    The second bit can be 0 or 1 after each of the one-bit states, so the number of states doubles rather than going up by one.

  • A character set needs sequences long enough to give every character its own unique code.
  • Computers must use the same character set, so one sequence means the same character on every device.
  • Characters include upper and lower case letters (different characters), numbers, punctuation, spaces, and control characters such as enter and tab.
  • ASCII uses a seven-bit sequence for each character, which gives 128 possible characters.
  • Have a goYour cousin swears she can fit 200 different characters into ASCII, one seven-bit sequence each. Bold claim. Can she?

    No. Seven bits only give 128 states.

    Every character needs its own unique sequence, and seven bits make only 2 to the power of 7 = 128 of them, so the codes run out long before 200.

  • In ASCII, the letters and their sequences go in order.
  • ASCII covers Western (basic English) alphabets only, so it has no code for Urdu letters or emojis.
  • Unicode uses up to 32 bits (four bytes) per character, so it covers far more languages and symbols, emojis included.
  • Unicode's first 128 characters match ASCII's, so a Unicode system displays ASCII text correctly.
  • Have a goMaya opens an old ASCII text file on a phone that uses Unicode. She is sure it will turn into missing characters. Is she right?

    No. The text displays correctly.

    Unicode's first 128 characters are the same as ASCII's, so the phone has a matching code for every character in the file.

The big picture

A character set matches each character to a unique binary sequence, so a computer can store and process text as binary. The length of the sequence decides how many characters can have their own code: each extra bit doubles the states. ASCII uses seven bits and covers Western alphabets only, while Unicode uses up to 32 bits, reaches far more languages, symbols and emojis, and begins with the same characters as ASCII.

Key points

1A character set is a record of characters matched to unique binary sequences, so a computer can store and process text as binary.
2A sequence of n bits has 2 to the power of n states, so each extra bit doubles the number of states and a character set needs a long enough sequence to give every character its own code.
3Computers must use the same character set so that a binary sequence matches the same character on every device, for example when text is sent in an email.
4ASCII (American Standard Code for Information Interchange) uses a seven-bit sequence per character, so it has 128 possible characters. Its letters go in order, and the upper and lower case versions of a letter differ in only one bit.
5ASCII is specified for Western (basic English) alphabets only, so it cannot represent writing systems such as Urdu, or emojis.
6Unicode uses up to 32 bits (four bytes) per character, so it represents a far wider range of languages and symbols. Its first 128 characters are the same as ASCII's, so it can display ASCII text correctly.

Worked example

Problem

You are inventing a toy character set for a game. It has 20 characters, and each one needs its own unique binary sequence, all the same length. Should the sequences be 4 bits long or 7 bits long?

⚠ Watch out

Treating a capital letter and its lower case version as the same character. They are different characters with different sequences; in ASCII the two sequences differ in only one bit.

🧠

Memory hook

Add one bit and the codes double. That is why seven bits stop ASCII at 128 characters, and why Unicode, with far longer sequences, can keep going.

✓

Check yourself

Without looking back: why do seven bits limit ASCII to 128 characters, and what does Unicode do about that limit?

Flashcards

(14)
What is a character set?
A record of characters matched to unique binary sequences, so a computer can store and process text as binary.
How many states does a sequence of n bits have?
2 to the power of n. Each extra bit doubles the number of states.
Why does a character set need a long enough binary sequence?
Every character needs its own unique code, and a sequence only has so many different states.
Why must computers use the same character set?
So that a binary sequence matches the same character on every device, for example when text is sent in an email.
Which kinds of character does a character set have to represent?
Upper and lower case letters, numbers, punctuation, spaces, and control or special characters such as enter and tab.
Are 'a' and 'A' the same character?
No. Upper and lower case letters are treated as different characters, each with its own sequence.
What does ASCII stand for?
American Standard Code for Information Interchange.
How do the letters sit in ASCII?
The letters and their binary sequences go in order.
How do the ASCII sequences for a letter's two cases compare?
They differ in only one bit of the seven-bit sequence.
Why can't ASCII represent Urdu or emojis?
ASCII is specified for Western (basic English) alphabets only.
How many bits per character can Unicode use?
Up to 32 bits, which is four bytes.
What does Unicode share with ASCII?
Its first 128 characters are the same, so a Unicode system can display ASCII text correctly.
What does an ASCII-only system show for a character it has no code for?
A missing character.
Which came first, ASCII or Unicode?
ASCII, first used in 1963. Unicode was first used in 1991.

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