Skip to main content
EnglandComputer ScienceSyllabus dot point

How do computers encode characters using 7-bit ASCII?

Understand how computers encode characters using 7-bit ASCII.

A focused answer to Edexcel GCSE Computer Science 2.2.1, covering how computers encode characters using a character set, the 7-bit ASCII system, its 128 codes, and the ordering of letters and digits.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Character sets
  3. 7-bit ASCII
  4. The ordering of codes
  5. Limitations and larger sets
  6. Try this

What this dot point is asking

Edexcel wants you to explain how text is represented in binary using a character set, specifically the 7-bit ASCII system: how each character maps to a unique binary code, how many characters 7 bits allow, and how the codes are ordered.

Character sets

Storing text is just storing numbers: each character is looked up in the character set to get its code, and the codes are stored as binary. To display the text, the codes are looked up again to get the characters. The character set is what gives the bits meaning as text rather than, say, a number or a pixel colour.

7-bit ASCII

Edexcel specifically names 7-bit ASCII, so the key figure to know is 128 characters from 7 bits. In practice each ASCII character is usually stored in a byte (8 bits) with the leftmost bit set to 0, but the code itself only needs 7 bits. Knowing 27=1282^7 = 128 lets you answer "how many characters" questions directly from the number of bits.

The ordering of codes

This consecutive ordering is why string sorting and case conversion work simply. Because uppercase letters all have smaller codes than lowercase, a code-based sort puts "Apple" before "apple". Because 'a' (97) is exactly 32 more than 'A' (65), you can convert a letter's case by adding or subtracting 32. These tricks all rely on the ordered codes.

Limitations and larger sets

The strength of 7-bit ASCII, its small fixed size, is also its limitation: 128 codes are not enough for the characters of most of the world's languages, accented letters, or symbols such as emoji. Larger character sets such as Unicode use more bits per character to provide tens of thousands of codes covering many languages and symbols, at the cost of more storage per character. Edexcel's named system is 7-bit ASCII, but you should know that its limited size is why bigger sets exist.

Try this

Q1. State how many characters 7-bit ASCII can represent. [1 mark]

  • Cue. 128, because 27=1282^7 = 128.

Q2. Given 'a' is 97, state the ASCII code for 'd'. [1 mark]

  • Cue. 100, because d is three places after a (97+397 + 3).

Exam-style practice questions

Practice questions written in the style of Pearson Edexcel exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Edexcel 20223 marksThe ASCII code for the character 'A' is 65. State the ASCII code for 'C' and explain how you worked it out.
Show worked answer →

ASCII codes the uppercase letters in alphabetical order with consecutive values, so each next letter is one greater.

'A' is 65, so 'B' is 66 and 'C' is 67. You add the position offset: C is two letters after A, so 65+2=6765 + 2 = 67.

Markers reward the answer 67 and the reasoning that the letters are stored in consecutive, ascending codes, so you add the offset from A. The same logic applies to lowercase ('a' is 97) and digits ('0' is 48).

Edexcel 20212 marksState how many different characters 7-bit ASCII can represent, and give one reason this number can be a limitation.
Show worked answer →

With 7 bits there are 27=1282^7 = 128 possible codes, so 7-bit ASCII can represent 128 characters.

This is a limitation because 128 codes are only enough for the English letters, digits, punctuation and control codes; they cannot represent the characters of many other languages or symbols such as emoji, which need a larger character set such as Unicode.

Markers reward the value 128 (from 272^7) and a valid limitation (too few codes for other alphabets, accented letters or emoji).

Related dot points

Sources & how we know this