REVISION GUIDE · IGCSE 0478 AND A LEVEL 9618

How to calculate image and sound file sizes

The two formulas, step-by-step worked examples in bytes, KiB and MiB, and the unit slips that lose easy marks.

1. The units

UnitSize
1 byte8 bits
1 kibibyte (KiB)1024 bytes
1 mebibyte (MiB)1024 KiB
1 gibibyte (GiB)1024 MiB
1 tebibyte (TiB)1024 GiB

Cambridge also uses denary prefixes, where 1 kilobyte (kB) = 1000 bytes. Read the question carefully: KiB and MiB mean you divide by 1024.

2. Image file size

File size in bits = width in pixels × height in pixels × colour depth

Colour depth is the number of bits used for each pixel.

Example: a 1024 × 768 image with a colour depth of 24 bits.

StepWorkingResult
Pixels1024 × 768786 432 pixels
Bits786 432 × 2418 874 368 bits
Bytes÷ 82 359 296 bytes
KiB÷ 10242304 KiB
MiB÷ 10242.25 MiB

3. Sound file size

File size in bits = sample rate × sample resolution × length in seconds

Sample rate is the number of samples taken each second, in hertz (Hz). Sample resolution is the number of bits stored for each sample.

Example: 10 seconds of sound sampled at 44 100 Hz with a 16-bit sample resolution.

StepWorkingResult
Bits44 100 × 16 × 107 056 000 bits
Bytes÷ 8882 000 bytes
KiB÷ 1024861.3 KiB (to 1 decimal place)
If a question says the recording is in stereo, there are two channels, so multiply by 2. Only do this when the question says so.

4. Why the numbers matter

More pixels or a higher colour depth give a better image but a larger file. A higher sample rate or resolution gives a more accurate recording but a larger file. Large files take longer to send and use more storage, which is why files are compressed. Lossy compression removes data permanently, as in MP3 and JPEG. Lossless compression lets the original be rebuilt exactly, as in run-length encoding.

5. Mistakes that cost marks

  • Forgetting to divide by 8 to change bits into bytes.
  • Dividing by 1000 when the question asks for KiB or MiB.
  • Leaving the length in minutes instead of seconds.
  • Not showing working. Method marks are given for each correct step even if the final answer is wrong.
  • Giving a final answer without units.

6. How to practise

The IGCSE Data representation page has notes, self-marking practice and a video lesson, and the A Level Information representation page covers the 9618 content. Our binary, hex and two’s complement cheat sheet is useful for the rest of the topic.

Frequently asked questions

How do you calculate the file size of an image?

Multiply the width in pixels by the height in pixels by the colour depth to get the size in bits. Divide by 8 for bytes, then by 1024 for KiB and again for MiB.

How do you calculate the file size of a sound file?

Multiply the sample rate in hertz by the sample resolution in bits by the length in seconds. This gives bits; divide by 8 for bytes.

Should I divide by 1000 or 1024?

Divide by 1024 when the answer is in KiB, MiB or GiB. Divide by 1000 only when the question uses denary units such as kB or MB.

Want help with data representation? In a 1-to-1 lesson we can practise file size, binary and hexadecimal questions together. Book a free demo →

Was this page helpful?