Study Guide
Measuring Storage and File Sizes
How storage is measured from bits to exbibytes using 1024, how kibi differs from kilo, and how to calculate the size of an image file and a sound file and give the answer in the unit asked for.
Lesson 1.9 Data Representation
For: Cambridge IGCSE Computer Science learners, or anyone who has met images and sound stored as binary
Stage: Think
Why one unit is not enough
A fictional phone shows a message: “Storage almost full”. A text message takes a few hundred bits, a photo takes millions, and a film takes billions. All of them are measured in bits and bytes, but it would be awkward to write the size of a film as a number of bits.
Think it through
Lengths are measured in millimetres, metres and kilometres. Why do you think data is measured in several units too, and how many of one unit do you expect to make the next?
- Hint 1: How many millimetres are there in a kilometre?
- Hint 2: Data in computers is built from bits, which have two states. What size of group might be convenient?
Show what happens
Different sizes need different units, just as a kilometre is better for a road than a millimetre. Each unit is made of a number of the one below it. For lengths it is 10, 100 or 1000. For data, as the rest of this lesson shows, it is 1024.
The smallest unit is the bit, a single 0 or 1. A group of 4 bits is a nibble and a group of 8 bits is a byte. So there are 8 bits in a byte, and 2 nibbles in a byte.
Stage: Discover
Why 1024?
Think it through
Computers work in powers of 2: 2, 4, 8, 16, 32 and so on. Keep doubling from 2 until you reach a number just above 1000. Which power of 2 is it, and what number is it?
- Hint 1: 2, 4, 8, 16, 32, 64 …
- Hint 2: It is 2 multiplied by itself ten times.
Show what happens
2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. It is 2¹⁰ = 1024, the power of 2 closest to 1000. A unit of 1024 bytes fits the way a computer counts, with a neat power of 2, while 1000 does not.
Each unit of storage is 1024 of the one below it. The names join the start of a metric prefix to “bi” for “binary”: kilo and binary make kibi, mega and binary make mebi, and so on. This gives:
- 1 kibibyte (KiB) = 1024 bytes
- 1 mebibyte (MiB) = 1024 KiB
- 1 gibibyte (GiB) = 1024 MiB
- 1 tebibyte (TiB) = 1024 GiB
- 1 pebibyte (PiB) = 1024 TiB
- 1 exbibyte (EiB) = 1024 PiB
Going up one unit, divide by 1024. Going down one unit, multiply by 1024.
- Decide the direction. KiB is one unit below MiB, so the number gets bigger: multiply by 1024.
- Convert to KiB. 3 × 1024 = 3072 KiB.
- Go down once more, to bytes. Bytes are one unit below KiB, so multiply by 1024 again: 3072 × 1024 = 3 145 728 bytes.
- Check the other way. 3 145 728 ÷ 1024 = 3072, and 3072 ÷ 1024 = 3. The answer returns to 3 MiB.
| Starting size | Convert to | Answer |
|---|---|---|
| 3 MiB | KiB | 3072 |
| 16 bits | bytes | |
| 8192 bytes | KiB | |
| 5 GiB | MiB | |
| 4096 MiB | GiB | |
| 2 TiB | GiB | |
| 1 EiB | TiB |
- Going to a smaller unit, multiply by 1024 for each step down. Going to a bigger unit, divide by 1024 for each step up.
- Bits and bytes: divide the bits by 8.
Show the completed table
| Starting size | Convert to | Answer |
|---|---|---|
| 3 MiB | KiB | 3072 |
| 16 bits | bytes | 2 |
| 8192 bytes | KiB | 8 |
| 5 GiB | MiB | 5120 |
| 4096 MiB | GiB | 4 |
| 2 TiB | GiB | 2048 |
| 1 EiB | TiB | 1 048 576 |
Check your understanding
Show the answer
Answer: B. 6144 MiB, because 6 × 1024 = 6144.
1 GiB is 1024 MiB, so 6 GiB is 6 × 1024 = 6144 MiB. There are more of the smaller unit.
Stage: Predict
Kibi and kilo
A fictional shop sells a hard drive as “1 TB”. The computer that it is plugged into reports its size as about 931 GiB, and the buyer worries that something is missing.
Think it through
Has the shop cheated? Think about what the prefix “tera” means in the shop’s label, and what “tebi” means to the computer.
- Hint 1: Is “1 TB” the same unit as “1 TiB”?
- Hint 2: Which one uses multiples of 1000, and which of 1024?
Do not confuse: Decimal prefixes and binary prefixes
- Based on 1000Kilo, mega, giga, tera
- The decimal (metric) prefixes. 1 kilobyte (kB) = 1000 bytes, 1 megabyte (MB) = 1000 kB, and so on.1 TB = 1 000 000 000 000 bytes.
- Based on 1024Kibi, mebi, gibi, tebi
- The binary prefixes. 1 KiB = 1024 bytes, 1 MiB = 1024 KiB, and so on.1 TiB = 1 099 511 627 776 bytes.
The gap grows with each prefix: a kibibyte is about 2.4% bigger than a kilobyte, a mebibyte about 4.9% bigger than a megabyte, a gibibyte about 7.4% bigger than a gigabyte and a tebibyte about 10% bigger than a terabyte.
Everyday labels often use kilobyte, megabyte and gigabyte loosely, and some software uses them for 1024. That is why the names KiB, MiB and GiB were agreed: they always mean 1024. In IGCSE Computer Science calculations, use 1024 and never 1000, and give the answer in the unit the question asks for. At A level you are also expected to explain the difference between kibi and kilo, and between mebi and mega, gibi and giga, and tebi and tera.
Check your understanding
Show the answer
Answer: C. Less than 500 GiB, because a GiB is bigger than a GB.
A GiB (1 073 741 824 bytes) is bigger than a GB (1 000 000 000 bytes), so the same drive is a smaller number of GiB: about 465.7. No bytes are missing.
Stage: Predict
The size of an image file
Think it through
An image is 8 pixels wide and 6 pixels tall, with a colour depth of 2 bits. How many bits does it take, and how many bytes?
- Hint 1: How many pixels are there? How many bits for each?
- Hint 2: Divide the bits by 8 to find the bytes.
The same working finds the size of any image:
file size in bits = width × height × colour depth.
Divide by 8 to get bytes, and by 1024 for each larger unit that you need. Do the working in order, and always say which unit the answer is in.
- Find the number of pixels. 1024 × 768 = 786 432 pixels.
- Multiply by the colour depth. 786 432 × 24 = 18 874 368 bits.
- Change bits into bytes. 18 874 368 ÷ 8 = 2 359 296 bytes. (There are 8 bits in a byte.)
- Change bytes into KiB. 2 359 296 ÷ 1024 = 2304 KiB.
- Change KiB into MiB. 2304 ÷ 1024 = 2.25 MiB, which is the unit that the question asked for.
A shorter way: 24 bits is 3 bytes, so each pixel takes 3 bytes, and 786 432 × 3 = 2 359 296 bytes. Working in bytes from the start avoids a large multiplication.
Numbers that are powers of 2 divide cleanly, so no calculator is needed. Work in bytes first, using the bytes for each pixel (colour depth ÷ 8).
| Width × height | Colour depth | Size in bytes | Size in KiB |
|---|---|---|---|
| 32 × 32 | 8 bits | 1024 | 1 |
| 64 × 64 | 8 bits | ||
| 1024 × 512 | 16 bits | ||
| 512 × 512 | 24 bits |
- Pixels × colour depth gives bits. Divide by 8 for bytes, and by 1024 for KiB.
- A colour depth of 8 bits is 1 byte for each pixel, 16 bits is 2 bytes, and 24 bits is 3 bytes.
Show the completed table
| Width × height | Colour depth | Size in bytes | Size in KiB |
|---|---|---|---|
| 32 × 32 | 8 bits | 1024 | 1 |
| 64 × 64 | 8 bits | 4096 | 4 |
| 1024 × 512 | 16 bits | 1 048 576 | 1024 |
| 512 × 512 | 24 bits | 786 432 | 768 |
Apply it
Show the answer
Answer: A. 32 768 is a number of bits. It must be divided by 8 for bytes, then by 1024 for KiB.
The product is in bits. 32 768 ÷ 8 = 4096 bytes, and 4096 ÷ 1024 = 4 KiB. Tom has the right number, in the wrong unit.
Stage: Predict
The size of a sound file
Think it through
A fictional recorder takes 1000 samples every second, and each sample is 8 bits. How many bits does it store in 1 second, and in 10 seconds? Which rule do you think follows for any recording?
- Hint 1: Samples each second × bits for each sample.
- Hint 2: Then multiply by the number of seconds.
Show what happens
In 1 second: 1000 × 8 = 8000 bits. In 10 seconds: 8000 × 10 = 80 000 bits. The rule: file size in bits = sample rate × sample resolution × length in seconds.
As with an image, divide by 8 for bytes and by 1024 for each larger unit.
- Find the number of samples. 16 000 samples each second × 64 seconds = 1 024 000 samples.
- Multiply by the sample resolution. 1 024 000 × 16 = 16 384 000 bits.
- Change bits into bytes. 16 384 000 ÷ 8 = 2 048 000 bytes.
- Change bytes into KiB. 2 048 000 ÷ 1024 = 2000 KiB, as asked.
Why this unit? The question asked for KiB. In MiB the answer would be 2000 ÷ 1024 = just under 2 MiB, because 2 MiB is 2048 KiB. The size is the same, written in a different unit.
The sample rates here are lower than real ones, so that every answer divides cleanly. The length must be in seconds.
| Sample rate | Sample resolution | Length | Size in bytes | Size in KiB |
|---|---|---|---|---|
| 2048 Hz | 16 bits | 32 seconds | 131 072 | 128 |
| 8000 Hz | 8 bits | 128 seconds | ||
| 4096 Hz | 8 bits | 64 seconds | ||
| 1024 Hz | 16 bits | 16 seconds |
- Sample rate × sample resolution × seconds gives bits. Divide by 8 for bytes, and by 1024 for KiB.
Show the completed table
| Sample rate | Sample resolution | Length | Size in bytes | Size in KiB |
|---|---|---|---|---|
| 2048 Hz | 16 bits | 32 seconds | 131 072 | 128 |
| 8000 Hz | 8 bits | 128 seconds | 1 024 000 | 1000 |
| 4096 Hz | 8 bits | 64 seconds | 262 144 | 256 |
| 1024 Hz | 16 bits | 16 seconds | 32 768 | 32 |
Apply it
Show the answer
Answer: C. 960 KiB, which is 983 040 bytes ÷ 1024.
The length has to be in seconds: 2 × 60 = 120. Bits: 4096 × 16 × 120 = 7 864 320. Bytes: ÷ 8 = 983 040. KiB: ÷ 1024 = 960.
Go deeper Beyond the specification: stereo and real files
The sound formula describes one channel. A stereo recording has two channels, one for each speaker, so its size is twice as much: sample rate × sample resolution × seconds × 2. The specification gives only the three numbers you have used.
A real image or sound file is a little bigger than the calculation says, because it also stores a header with details such as the width, height and colour depth. The calculation gives the size of the data itself, which is almost all of the file.
Stage: Apply
Use a size to decide
Apply it
Show the answer
Answer: C. 40 photos, because 40 × 2.25 = 90 MiB.
The card’s size is divided by the size of one photo: 90 ÷ 2.25 = 40. Check by multiplying back: 40 × 2.25 = 90 MiB.
Apply it
Show the answer
Answer: B. 2048 clips, because 2 × 1024 MiB = 2048 MiB.
2 GiB = 2 × 1024 = 2048 MiB, and 2048 ÷ 1 = 2048 clips. Always change both sizes into the same unit before comparing or dividing.
Stage: Consolidate
Bring it together
Think it through
Without looking back, explain to a friend how to find the size of an image of 512 × 512 pixels with a colour depth of 24 bits, and give the answer in KiB.
Check your understanding
Show the answer
Answer: A. sample rate × sample resolution × length in seconds
Sample rate × sample resolution × length in seconds gives the size in bits. Divide by 8 to find bytes.
- A bit is one 0 or 1. A nibble is 4 bits and a byte is 8 bits.
- Storage units go up in steps of 1024: byte, KiB, MiB, GiB, TiB, PiB, EiB. Divide by 1024 to go up a unit, and multiply by 1024 to go down.
- Kilo, mega, giga and tera are decimal prefixes (1000). Kibi, mebi, gibi and tebi are binary prefixes (1024). In calculations here, use 1024 and not 1000.
- Image size in bits = width × height × colour depth. Sound size in bits = sample rate × sample resolution × seconds. Divide by 8 for bytes, then by 1024 for each larger unit.
- Give the answer in the unit the question asks for, and change both sizes into the same unit before comparing them.
Sources and scope
- What this lesson is. The ninth lesson of the Data Representation module, written for this site. It teaches points 1 and 2 of Cambridge IGCSE Computer Science 1.3 (measuring data storage and calculating file sizes) against the 2026 to 2028 syllabus (version 6), and the binary prefixes of 9618 point 1.1. Its curriculum links are provisional: no link has been verified by the site owner. They show where the lesson may help with a course and imply no review or endorsement by any examination board.
- Original material. The phone, the shop’s drive, the recorders, the memory card, the music app and Tom’s working are fictional examples written for this lesson. Image and sound sizes are chosen so that every calculation divides cleanly without a calculator; real recordings use higher sample rates, such as 44 100 Hz.
- Simplified on purpose. The calculations give the size of the data alone, not of the file with its header. Stereo sound is only in the optional extension. Compression, which changes the size of a file, is in the next lesson.
The number system with only two digits, 0 and 1, in which each column is worth twice the column to its right.
A single binary digit: 0 or 1. The smallest unit of data a computer stores.
A group of eight bits, which can hold one of 256 different patterns.
The number of bits used to store the colour of each pixel, so that n bits give 2ⁿ possible colours.
Making a file smaller, so that it needs less storage space and bandwidth and is sent in less time.
The everyday number system with ten digits, 0 to 9, in which each column is worth ten times the column to its right.
A unit of storage equal to 1024 pebibytes.
A unit of storage equal to 1024 mebibytes.
The unit for how often something happens each second: a sample rate of 1000 Hz means 1000 samples every second.
A unit of storage equal to 1024 bytes.
A unit of storage equal to 1024 kibibytes.
A group of four bits, half a byte, which can hold one of 16 patterns and so can be written as one hexadecimal digit.
A unit of storage equal to 1024 tebibytes.
One of the tiny squares that make up an image, each of which has a single colour stored as a binary code.
One measurement of the height of a sound wave, taken at one moment.
The number of samples taken of a sound in each second, measured in hertz.
The number of bits used to store each sample of a sound, which sets how many levels each sample can take.
A unit of storage equal to 1024 gibibytes.
Your progress on this lesson
Saved in this browser only. It is not sent anywhere, does not follow you to another device, and is lost if you clear this site’s data.
This browser is not allowing the site to save progress, so it will be forgotten when you leave the page.