KS41CP2 2.2 30 min read 10 question quiz 13 exam marks

Representing Text, Images and Sound

Character sets, bitmap images and sampled sound, and every calculation Edexcel can ask you to do on each, with the conversions set out step by step.

Representing text

A computer stores only numbers, so text is turned into numbers using a character set: an agreed table giving every character a unique binary code.

ASCII

ASCII uses 7 bits, giving 2 to the power 7, which is 128 codes. That covers the English alphabet in both cases, the digits, punctuation and control characters such as carriage return. Extended ASCII uses 8 bits and has 256 codes.

The codes are assigned in order, which is useful:

  • 'A' is 65, so 'B' is 66 and 'Z' is 90.
  • 'a' is 97, so lower case is always upper case plus 32.
  • '0' is 48, so the value of a digit character is its code minus 48.
The character '7' is not the number 7

'7' is stored as the code 55. That is why anything typed at a keyboard must be converted before it can be used in arithmetic.

Unicode

ASCII has no codes for Greek, Arabic, Chinese, Hindi or emoji. Unicode uses more bits per character and has room for over a million codes, which covers every writing system in current use.

The trade is storage: characters outside the basic set need more than one byte. The first 128 Unicode codes are deliberately identical to ASCII, so plain English text costs the same in both and every existing ASCII file is already valid Unicode.

Calculating the size of a text file

size in bits = number of characters x bits per character

A 500 character message in 8 bit extended ASCII is 500 times 8, which is 4000 bits, or 500 bytes. Spaces and punctuation are characters and must be counted.

Characters stored as numbers, and the three character sets ASCII, extended ASCII and UnicodeComputers store text as numbers. A character set is the agreed list that says which number means which character. In ASCII the capital letter A is 65, which is 0100 0001 in binary, B is 66, a lower case a is 97 and the character 7 is 55. The codes run in order, so B is always one more than A, and a lower case letter is 32 higher than its capital. The character 7 is text with code 55, which is different from the number 7. Below are three character sets. ASCII uses 7 bits per character and so holds 128 characters. Extended ASCII uses 8 bits and holds 256, adding accents and symbols such as é, ñ and £. Unicode uses up to 32 bits and holds over a million characters, covering every writing system and emoji, with the first 128 codes kept the same as ASCII.Every character is stored as a numberA6501000001B6601000010a970110000175500110111Codes run in order:A 65, B 66, C 67 ...Lower case is 32 higher:a is 97, A is 65The character 7 is code 55,not the number 7Three character setsASCII7 bits each128 charactersAz5?Extended ASCII8 bits each256 characterséñ£©Unicodeup to 32 bits eachover a millionΩЖ123
  1. Each character has a code number, and the computer stores that number in binary.
  2. The codes run in order, so you can work out C from A. The character 7 is not the number 7.
  3. More bits per character means more characters: 128, then 256, then over a million.
A character set is just an agreed table of numbers. Unicode is needed because 256 characters cannot cover the world's languages.

Representing images

A bitmap image is stored as a grid of pixels, with a binary value recorded for the colour of every pixel.

Resolution is the number of pixels, given as width by height. More pixels means more detail and proportionally more data.

Colour depth is the number of bits used per pixel, and it decides how many colours a pixel can be:

Colour depthColours
1 bit2
4 bit16
8 bit256
24 bit16 777 216

Metadata is data about the file: width, height, colour depth, format, date. Without the width, software cannot know where each row of pixels ends, so the picture cannot be reconstructed at all.

Calculating image file size

size in bits = width x height x colour depth

An image 1024 by 768 at 24 bit colour:

pixels        = 1024 x 768           = 786 432
size in bits  = 786 432 x 24         = 18 874 368 bits
size in bytes = 18 874 368 / 8       = 2 359 296 bytes
size in KiB   = 2 359 296 / 1024     = 2 304 KiB
size in MiB   = 2 304 / 1024         = 2.25 MiB
Edexcel uses binary prefixes

A kibibyte is 1024 bytes, a mebibyte is 1024 kibibytes. Dividing by 1000 will not match the mark scheme.

How a bitmap image is stored, and what decides its sizeAn eight by eight bitmap image of a simple face shown next to the binary that stores it. Each square of the picture is one pixel, and because this image uses one bit per pixel each pixel is either 0 for the background or 1 for the ink. The eight rows of bits are 00111100, 01000010, 10100101, 10000001, 10100101, 10011001, 01000010 and 00111100. Three properties decide the file. Resolution is how many pixels across by how many down, here eight by eight, giving 64 pixels in total. Colour depth is how many bits are stored per pixel: one bit gives two colours, eight bits gives 256 colours and 24 bits gives about 16.7 million. Metadata is the extra information stored with the image, such as width, height, colour depth and date, so that software can open it correctly. File size in bits equals width times height times colour depth, plus the metadata.An 8 by 8 image, one bit per pixelthe picture0 0 1 1 1 1 0 00 1 0 0 0 0 1 01 0 1 0 0 1 0 11 0 0 0 0 0 0 11 0 1 0 0 1 0 11 0 0 1 1 0 0 10 1 0 0 0 0 1 00 0 1 1 1 1 0 0the same thing, stored as bitsResolutionhow many pixels across by how manydown. Here 8 x 8, so 64 pixels.Colour depthbits per pixel. 1 bit gives 2 colours,8 gives 256, 24 gives 16.7 million.Metadatawidth, height, colour depth, date,so the file can be opened correctly.file size in bits = width x height x colour depth, then add the metadata
Increasing colour depth by one bit doubles the number of available colours and adds one bit to every single pixel.
How a bitmap image is stored: a grid of pixels, each three numbersHow a bitmap image is stored. The image is a grid of pixels, and this one is eight by eight, so sixty four pixels in total. Every pixel holds one colour, and that colour is stored as three numbers: how much red, how much green and how much blue. In 24 bit colour each of those three numbers gets eight bits, so one pixel costs 8 plus 8 plus 8, which is 24 bits or 3 bytes. The colour depth is simply how many bits each pixel gets. The file size in bits is the width times the height times the colour depth: for this image 8 times 8 times 24 is 1,536 bits, and dividing by 8 gives 192 bytes.8 pixels wide8 tall: 64 pixels in allone pixelR24011110000G10301100111B91010110113 numbers × 8 bits = 24 bits = 3 bytesFile size in bits8width×8height×24colour depth= 1,536 bits, and ÷ 8 = 192 bytes1234
  1. A bitmap is a grid of pixels. This one is 8 by 8, so 64 of them.
  2. Pick one pixel. Its colour is three numbers: red, green and blue.
  3. Each number is 8 bits, so one pixel costs 24 bits, which is 3 bytes.
  4. File size = width × height × colour depth. That is the whole formula.
Width times height times colour depth gives bits. Divide by 8 for bytes. Every image file size question is that line and nothing more.
A photograph and the metadata stored with itAn image file holds more than the pixels. Metadata is data about the data: it is stored in the file but it is not part of the picture. Some metadata is needed to rebuild and show the image: the width and height in pixels, here 4032 by 3024, the colour depth, here 24 bits, and the file type, here JPEG. Other metadata is extra information: the date and time the photo was taken, the device, the resolution in pixels per inch, and the GPS location, here 51.50 north, 0.12 west. Without the width, height and colour depth the computer would not know how to turn the stream of bits back into a grid of pixels. The extra information can be a privacy risk, because a photo shared online can reveal where it was taken.IMG_0412.jpgthe pixels you seeMetadata: data about the dataneeded to show the pictureWidth4032 pxHeight3024 pxColour depth24 bitsFile typeJPEGextra informationDate taken14 Jun 2026 09:41DevicesmartphoneLocation51.50 N, 0.12 WResolution300 ppiFile size = width × height × colour depth, plus a little for the metadata.123
  1. The picture is a grid of pixels, stored as one long stream of bits.
  2. Metadata that must be stored: width, height and colour depth. Without them the bits cannot be turned back into the picture.
  3. Extra metadata such as date, device and GPS location is useful, but sharing it can be a privacy risk.
Metadata is data about the data. It is not part of the picture, but the file would not open properly without the key parts.

Representing sound

Sound is an analogue wave: continuous, with a value at every instant. A computer cannot store something continuous, so the wave is sampled, meaning its height is measured at regular intervals and each measurement is stored as a binary number.

The result is a staircase that follows the wave without exactly matching it. How close it gets depends on two things.

Sample rate is how many samples are taken each second, in hertz. A higher rate means narrower steps, so rapid changes and higher frequencies survive. CD audio uses 44100 Hz.

Bit depth, also called sample resolution, is how many bits store each sample. Eight bits gives 256 possible levels, sixteen gives 65536. Every measured height is rounded to the nearest available level, so more bits means less rounding and a more faithful recording.

Calculating sound file size

size in bits = sample rate x bit depth x seconds x channels

A 2 minute stereo recording at 44100 Hz and 16 bits:

seconds       = 2 x 60                        = 120
size in bits  = 44100 x 16 x 120 x 2          = 169 344 000 bits
size in bytes = 169 344 000 / 8               = 21 168 000 bytes
size in KiB   = 21 168 000 / 1024             = 20 671.875 KiB
size in MiB   = 20 671.875 / 1024             ≈ 20.2 MiB
Convert minutes to seconds first

Write it as the first line of your working. It is the single most common lost mark on this question.

Sampling an analogue sound wave into digital dataA smooth analogue sound wave drawn as a continuous curve, with sampling shown on top of it. At sixteen evenly spaced moments the height of the wave is measured, marked by dots on the curve, and each measured height is rounded to the nearest of the available levels. Joining those rounded values produces a staircase that follows the curve but is not identical to it, and the difference between the staircase and the curve is the loss caused by digitising. Taking samples more often, a higher sample rate measured in hertz, makes the staircase steps narrower. Storing more bits per sample, a higher bit depth, gives more possible levels, so eight bits gives 256 levels and each step lands closer to the true height. Both improvements make the recording closer to the original and both make the file bigger. File size in bits equals sample rate times bit depth times length in seconds times number of channels.loudquiettimeSample ratehow many samples per second, in hertz.More samples means more detail across time.Bit depthbits stored per sample, so 8 bits gives 256 levels.More bits means each height is recorded more exactly.file size in bits = sample rate x bit depth x seconds x channels
Sample rate is how often you measure. Bit depth is how precisely you record each measurement. Examiners want both named, not just one.

File size calculator

Work out the size of an image, a sound file or a block of text, one conversion at a time. This tool needs JavaScript, so turn it on to use it. Everything you need to answer the exam question is explained in the text above.

Turning a sound wave into numbers by sampling itHow a sound is turned into numbers. Sound is a wave, a smooth and continuous change in air pressure, and a computer cannot store smooth because it can only store numbers. So it measures the height of the wave at regular intervals, and each measurement is a sample. The sample rate is how many measurements are taken each second, in hertz: with only eleven samples the recorded shape is a rough approximation of the original, while with more than thirty it follows the wave closely. The bit depth is how many bits each measurement is stored in, and so how finely the height is rounded: three bits give eight levels, each sample is rounded to the nearest one, and more bits give finer steps. Higher sample rate and higher bit depth both mean a closer recording and a bigger file.Sound is a smooth waveFew samples: a rough copyMany samples: a close copysample rate: 11 a secondsample rate: 34 a secondtime →Bit depthhow finely each height is rounded765432103 bits: 8 levelsmore bits: finer steps1234
  1. Sound is a wave: a smooth, continuous change in air pressure.
  2. A computer cannot store smooth. It measures the height at intervals.
  3. Sample more often and the shape you recorded is closer to the original.
  4. Bit depth is how finely each measurement is rounded.
Higher sample rate and higher bit depth both mean a closer recording and a bigger file. That trade is the whole topic.

Key terms you must be able to define

Character set
An agreed table giving every character a unique binary code.
ASCII
A 7 bit character set with 128 codes covering English text and control characters.
Unicode
A character set using more bits per character, covering over a million characters from every writing system.
Bitmap
An image stored as a grid of pixels with a colour value recorded for each.
Resolution
The number of pixels in an image, given as width by height.
Colour depth
The number of bits used to store the colour of each pixel.
Metadata
Data about a file, such as its width, height, colour depth and date.
Sampling
Measuring an analogue wave at regular intervals and storing each measurement as a number.
Sample rate
The number of samples taken per second, measured in hertz.
Bit depth
The number of bits used to store each individual sample.
Kibibyte
1024 bytes, the binary prefix unit Edexcel uses.

Flashcards

Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.

DefineCharacter set
AnswerAn agreed table giving every character a unique binary code.
DefineASCII
AnswerA 7 bit character set with 128 codes covering English text and control characters.
DefineUnicode
AnswerA character set using more bits per character, covering over a million characters from every writing system.
DefineBitmap
AnswerAn image stored as a grid of pixels with a colour value recorded for each.
DefineResolution
AnswerThe number of pixels in an image, given as width by height.
DefineColour depth
AnswerThe number of bits used to store the colour of each pixel.
DefineMetadata
AnswerData about a file, such as its width, height, colour depth and date.
DefineSampling
AnswerMeasuring an analogue wave at regular intervals and storing each measurement as a number.

Reach the top grade on this topic

Most of the marks here are arithmetic, and most of the lost marks are conversions.

Label your units as you go. Write "bits" and "bytes" beside each line of working. It makes a missing division by eight obvious to you before it is obvious to the examiner.

Divide by 1024, not 1000. Edexcel uses kibibytes and mebibytes. This is a genuine board difference and it changes your answer.

Give the mechanism, not the label. "Increasing colour depth adds bits to every single pixel, so the file grows in proportion" earns more than "more colours makes the file bigger".

Name both sound controls with their separate effects. Sample rate is detail across time, bit depth is detail in amplitude, and questions expect you to know which is which.

Mistakes that cost marks here

Avoid these
  • Dividing by 1000 rather than 1024. Edexcel uses binary prefixes.
  • Leaving the duration in minutes in a sound calculation.
  • Forgetting to multiply by two for a stereo recording.
  • Saying ASCII has 256 characters. Standard ASCII is 7 bit with 128.
  • Treating a digit character as its numeric value without converting it.
Fun fact

The reason a screenshot of a paragraph of text is hundreds of times larger than the text itself is that the image stores a colour for every pixel, including all the white space, while the text stores one code per character.

Knowledge check

0 of 10 answered
1How many characters can a 7 bit character set represent?
2If 'A' is 65 and 'a' is 97, what is the code for 'c'?
3What does colour depth control?
4An image is 500 by 400 pixels at 8 bit colour depth. What is its size in bits?
5Using Edexcel's units, how many bytes are in 2 kibibytes?
6What does a higher sample rate improve?
7A 30 second mono recording at 22050 Hz with 8 bit depth is how many bits?
8Why must an image file store its width as metadata?
9What is the main disadvantage of Unicode compared with ASCII?
10Doubling both the width and height of an image has what effect on file size?
Score 0 / 10

Exam-style questions

Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.

13 marks
1State what is meant by the term metadata in relation to an image file.2 marks
State

Mark scheme0 / 2
  • LData about the file rather than the picture content itself
  • LGives an example such as width, height, colour depth or date
Model answer

Metadata is data stored in a file that describes the file itself rather than forming part of the picture, such as its width and height in pixels, its colour depth, its format and the date it was created.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2An image is 800 pixels wide, 600 pixels high and has a colour depth of 16 bits. Calculate its size in kibibytes. Show your working.4 marks
Calculate

Mark scheme0 / 4
  • LMultiplies width by height
  • LMultiplies by the colour depth to get bits
  • LDivides by 8 to get bytes
  • LDivides by 1024 to give approximately 937.5 KiB
Model answer

The number of pixels is 800 multiplied by 600, which is 480000. At 16 bits each that is 480000 multiplied by 16, giving 7680000 bits. Dividing by 8 gives 960000 bytes. Dividing by 1024 gives 937.5 kibibytes.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3Explain the difference between sample rate and bit depth when recording sound.4 marks
Explain

Mark scheme0 / 4
  • LSample rate is the number of samples taken each second
  • LA higher sample rate captures faster changes and higher frequencies
  • LBit depth is the number of bits used to store each sample
  • LA higher bit depth gives more possible levels, so each height is recorded more accurately
Model answer

Sample rate is how many measurements of the wave are taken each second, measured in hertz. Raising it places the measurements closer together in time, so faster changes in the wave are captured and higher frequencies survive into the recording. Bit depth is how many bits are used to store each individual measurement. Raising it increases the number of levels a sample can take, so each measured height is rounded by a smaller amount and the recorded loudness is closer to the true value. The rate therefore controls detail across time and the bit depth controls detail in amplitude, and both increase the file size in direct proportion.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4Explain why a text file containing 2000 characters is much smaller than a screenshot of the same text.3 marks
Explain

Mark scheme0 / 3
  • LA text file stores one code per character
  • LAn image stores a colour value for every pixel
  • LThe image includes all the blank space, and there are far more pixels than characters
Model answer

A text file stores one character code per character, so 2000 characters in extended ASCII takes 2000 bytes. A screenshot is a bitmap, which stores a colour value for every single pixel in the picture. A modest screenshot of 1000 by 800 pixels contains 800000 pixels, and at 24 bit colour that is 2.4 megabytes before any compression. Crucially the image also has to store the blank background between and around the letters, because a bitmap has no concept of a character at all: it records only colours at positions.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 13