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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 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 .
Q2. Given 'a' is 97, state the ASCII code for 'd'. [1 mark]
- Cue. 100, because d is three places after a ().
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 .
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 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 ) and a valid limitation (too few codes for other alphabets, accented letters or emoji).
Related dot points
- Understand that computers use binary to represent data (numbers, text, sound, graphics) and program instructions, and determine the maximum number of states that can be represented by a binary pattern of a given length.
A focused answer to Edexcel GCSE Computer Science 2.1.1, covering why computers use binary to represent all data and instructions, and how to calculate the maximum number of states a binary pattern of a given length can represent.
- Understand how bitmap images are represented in binary (pixels, resolution, colour depth), how analogue sound is represented in binary (amplitude, sample rate, bit depth, sample interval), and the limitations of binary representation when constrained by the number of available bits.
A focused answer to Edexcel GCSE Computer Science 2.2.2, 2.2.3 and 2.2.4, covering bitmap images (pixels, resolution, colour depth), sampled sound (amplitude, sample rate, bit depth, sample interval), and the limitations of binary representation.
- Understand why hexadecimal notation is used and convert between hexadecimal and binary.
A focused answer to Edexcel GCSE Computer Science 2.1.6, covering why hexadecimal notation is used as a shorthand for binary and how to convert between hexadecimal, binary and denary.
- Write programs that manipulate strings (length, position, substrings, case conversion).
A focused answer to Edexcel GCSE Computer Science 6.3.3, covering string manipulation in Python: finding length, accessing characters by position, extracting substrings, and converting case.
- Understand that data storage is measured in binary multiples (bit, nibble, byte, kibibyte, mebibyte, gibibyte, tebibyte), construct expressions to calculate file sizes and data capacity, and understand the need for and methods of compression (lossless, lossy).
A focused answer to Edexcel GCSE Computer Science 2.3.1 and 2.3.2, covering the binary storage multiples (bit, nibble, byte, kibibyte up to tebibyte), file-size and capacity calculations, and lossy and lossless compression.
Sources & how we know this
- Pearson Edexcel GCSE (9-1) Computer Science (1CP2) specification — Pearson (2020)