How are letters, sounds and pictures all stored as binary numbers?
Explain how text (ASCII), sound (sampling) and images (pixels and colour depth) are represented as binary in a computer
A focused answer to the O-Level Computing point on representing data. How text uses character codes such as ASCII, how sound is sampled, and how images are stored as pixels with a colour depth, all as binary.
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
SEAB wants you to explain how three very different kinds of data, text, sound and images, are all stored as binary numbers. The central idea is that a computer can only hold binary, so each type of data is turned into numbers using an agreed scheme: a character code for text, sampling for sound, and a grid of coloured pixels for images.
The answer
Representing text with character codes
A computer cannot store a letter directly, so each character is given an agreed number by a character set. The most common is ASCII, which uses or bits per character. For example, the code for 'A' is , and the codes for the other capitals follow in order ('B' is , 'C' is , and so on). Lower-case letters start at 'a' = .
Because ASCII is a shared standard, the number always means 'A' on every computer, so text saved on one machine opens correctly on another. A newer standard, Unicode, extends this idea to cover characters from every language, including Chinese, Tamil and emoji, using more bits per character.
Representing sound by sampling
Sound is a continuous wave, but a computer needs discrete numbers. It measures (samples) the height of the wave many times per second and stores each measurement as a binary number. Two settings control the quality:
- Sample rate: how many samples are taken per second. A higher rate captures the wave more accurately.
- Bit depth: how many bits store each sample. More bits give finer steps in volume.
Higher sample rate and bit depth mean better quality but a larger file.
Representing images with pixels
A digital image is a grid of tiny dots called pixels. Each pixel stores a colour as a binary number. The number of bits used per pixel is the colour depth:
- bit per pixel gives colours (for example black and white).
- bits per pixel give colours.
- bits per pixel give millions of colours (true colour).
More bits per pixel allow more colours and so more detail, but make the file larger. The resolution (the number of pixels, such as width times height) also affects detail and size.
colour depth = bits per pixel
number of colours = 2 ^ (bits per pixel)
Examples in context
Example 1. A text message. When you type "Hi", the phone stores the ASCII codes and as binary. The receiving phone reads those numbers and looks them up in the same character set to display "Hi" exactly as sent.
Example 2. A photo versus a song. A high-resolution photo with -bit colour and millions of pixels, and a music track with a high sample rate and bit depth, are both large files for the same reason: more bits were used to capture more detail. Reducing either setting shrinks the file but lowers quality.
Try this
Q1. State how many colours a pixel can be at a colour depth of bits. [2 marks]
- Cue. colours.
Q2. Explain why ASCII is described as a standard. [2 marks]
- Cue. Every computer agrees the same number means the same character, so text is consistent when saved, sent and opened across machines.
Q3. State two settings that affect the quality and file size of a digital sound recording. [2 marks]
- Cue. The sample rate (samples per second) and the bit depth (bits per sample).
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original5 marks(a) The ASCII code for the letter 'A' is . State the ASCII code for 'C' and for 'a', explaining how you worked them out. (b) Explain why a computer needs a code such as ASCII to store text.Show worked answer →
(a) ASCII codes for capital letters run in order from 'A' = . 'C' is two letters after 'A', so its code is . Lower-case letters start at 'a' = , so 'a' has the code (it is more than 'A').
(b) A computer can only store binary numbers, not letters directly. ASCII gives every character an agreed number, so 'A' is stored as . Because the code is a shared standard, any program or computer reading that number knows it means 'A', so text can be saved, sent and opened consistently.
Markers reward 'C' = and 'a' = with reasoning, and the idea that a code maps each character to an agreed binary number.
Original4 marksAn image is stored using a colour depth of bit per pixel. (a) State how many different colours each pixel can be, and why. (b) Explain what happens to the file size and the image quality if the colour depth is increased to bits per pixel.Show worked answer →
(a) With bit per pixel, each pixel can be one of colours (for example black or white), because one bit has only two patterns, and .
(b) With bits per pixel, each pixel can be one of colours, so the image can show far more detail and shading, improving quality. However, each pixel now needs bits instead of , so the file size becomes about eight times larger. More bits per pixel means more colours but a bigger file.
Markers reward colours from bit, colours from bits, and the trade-off of higher quality against larger file size.
Related dot points
- Explain why computers use binary, describe place value in binary and hexadecimal, and state why hexadecimal is used as shorthand for binary
A focused answer to the O-Level Computing point on number systems. Why computers use binary, place value in binary and hexadecimal, the meaning of bits and bytes, and why hexadecimal is a compact shorthand for binary.
- Convert whole numbers between denary, binary and hexadecimal using place value, repeated division and nibble grouping
A focused answer to the O-Level Computing point on number base conversion. Converting between denary, binary and hexadecimal using place value, repeated division by two, and grouping binary into nibbles.
- Use units of storage from bit to terabyte, and explain lossless and lossy compression and why files are compressed
A focused answer to the O-Level Computing point on data measurement. Units from bit and byte up to terabyte, calculating file sizes, and the difference between lossless and lossy compression and why files are compressed.
- Perform binary addition showing carries, and explain overflow when a result exceeds the fixed width of a register
A focused answer to the O-Level Computing point on binary addition. Adding binary numbers column by column with carries, checking the result against denary, and understanding overflow in a fixed-width register.
- Use Python lists and strings, including indexing, length, looping over items, and basic operations like append and slicing
A focused answer to the O-Level Computing point on Python lists and strings. Creating lists, zero-based indexing, finding length with len(), looping over items, appending, and basic string operations and slicing.