Cambridge IGCSE · Computer Science
Data Storage & Compression
Computers only understand 1s and 0s — this chapter is about how we measure those bits, work out how big a file will be before we even create it, and then how we shrink files down so they take up less space without (usually) losing important information.
Summary — The Whole Chapter in One Glance
- Units of data are built from the bit upward — bit → nibble → byte → kibibyte → mebibyte → gibibyte, and so on — each one 1024× the size of the last (once you're past a byte).
- Kilobyte ≠ Kibibyte. Kilobyte (KB) uses powers of 10 (1000), Kibibyte (KiB) uses powers of 2 (1024). Exam answers almost always want the 1024 (binary) version.
- Converting units is just repeated multiplying or dividing by 1024 (or by 8 for bits↔bytes) — the direction depends on whether you're going up or down in size.
- Bitmap image file size = resolution (number of pixels) × colour depth (bits per pixel).
- Sound file size = sample rate × duration × sample resolution.
- Compression shrinks files to save storage space, reduce bandwidth use, and cut transmission time.
- Lossy compression permanently throws away some data — smaller files, but quality is reduced forever. Used for photos, video, music.
- Lossless compression is fully reversible — no data is lost, just re-encoded more efficiently. Used for documents, code, anything where accuracy matters.
- Run Length Encoding (RLE) is a lossless technique that replaces repeated ("runs" of) identical values with a shorter code showing the value and how many times it repeats.
1. Units of Data Storage
What actually is a "unit of data"?
Deep down, a computer only ever stores binary digits — 1s and 0s. A single one of these is called a bit (short for ). On its own, one bit can't say much — it can only be "on" or "off". So we group bits together into bigger and bigger chunks to represent more meaningful amounts of information, the same way we don't measure a person's height in millimetres — we group millimetres into centimetres, then metres.
| Unit | Symbol | Value |
| Bit | b | 1 or 0 |
| Nibble | — | 4 bits |
| Byte | B | 8 bits |
| Kibibyte | KiB | 1,024 B (2¹⁰) |
| Mebibyte | MiB | 1,024 KiB (2²⁰) |
| Gibibyte | GiB | 1,024 MiB (2³⁰) |
| Tebibyte | TiB | 1,024 GiB (2⁴⁰) |
| Pebibyte | PiB | 1,024 TiB (2⁵⁰) |
| Exbibyte | EiB | 1,024 PiB (2⁶⁰) |
Why does a byte matter so much? A single byte (8 bits) can represent 2⁸ = 256 different values — which happens to be enough to represent every letter, number, and symbol on a standard keyboard (that's exactly why the ASCII character set fits in one byte). This makes the byte the "natural" building block computers are organised around.
Kilobyte vs Kibibyte — the exam trap
You will see two very similar-looking units and it's extremely easy to mix them up:
- 1 kilobyte (KB) = 1000 bytes — this uses prefixes (powers of 10), the same system marketers use when they sell you a "500 GB" hard drive.
- 1 kibibyte (KiB) = 1024 bytes — this uses prefixes (powers of 2), which is how the computer itself actually addresses memory internally.
⚠️ Why your hard drive "loses" space
always work in 1024s (KiB, MiB, GiB…)
Converting between units
× 1024
e.g. converting GiB into MiB — you're breaking one big thing into 1024 smaller pieces, so you multiply.
÷ 1024
Exam Tips