Units and file size calculations

GCSE Computer Science (Edexcel) · Edexcel 1CP2 · 2.3.1 · Data › Data storage and compression

66 exam-style questions plus unlimited generated ones on this topic, at up to four difficulty levels, with full mark schemes. Notes and past-paper booklets are open to everyone. Practice needs a free account.

Or take a quick quiz: 10 questions on this subtopic in GCSE Computer Science (Edexcel), marked as you tap.

Revision notes

The units used to measure data storage (bit, nibble, byte, kibibyte, mebibyte, gibibyte and tebibyte), converting between them, and constructing expressions for file sizes and storage requirements. Paper 1 is taken without a calculator, so many questions ask you to construct an expression rather than work out the answer.

Key facts

  • 1 nibble = 4 bits; 1 byte = 8 bits
  • 1 KiB = 1024 bytes
  • 1 MiB = 1024 KiB
  • 1 GiB = 1024 MiB
  • 1 TiB = 1024 GiB
  • Smaller to larger unit: ÷ (8 or 1024); larger to smaller: × (8 or 1024)
  • Order: bit, nibble, byte, KiB, MiB, GiB, TiB
  • Number of files that fit = capacity ÷ file size, rounded down

Notes

The units

  • Bit: a single binary digit, 0 or 1. The smallest unit of data.
  • Nibble = 4 bits. Byte = 8 bits.
  • Kibibyte (KiB) = 1024 bytes. Mebibyte (MiB) = 1024 KiB. Gibibyte (GiB) = 1024 MiB. Tebibyte (TiB) = 1024 GiB.
  • These are binary multiples: 1024 = 210. Computers work in binary, so storage is measured in powers of 2.
  • Drive makers often use decimal units (1 TB = 1,000,000,000,000 bytes). A tebibyte is bigger than a terabyte, so a computer that measures in TiB shows a smaller number for the same drive. Grade 7+ only

Converting

diagram
  • To a larger unit, divide: bits ÷ 8 = bytes; bytes ÷ 1024 = KiB; KiB ÷ 1024 = MiB; MiB ÷ 1024 = GiB; GiB ÷ 1024 = TiB.
  • To a smaller unit, multiply: e.g. 3 GiB = 3 × 1024 = 3072 MiB.
  • bitbyteKiBMiBGiBTiB÷8×8÷1024×1024÷1024×1024÷1024×1024÷1024×1024to a larger unit: divideto a smaller unit: multiply
    8 bits = 1 byte; after that each unit is 1024 times the one before. (A nibble is 4 bits, half a byte.)
  • Several steps: 2 MiB in bits = 2 × 1024 × 1024 × 8.

File sizes and capacity

  • Text: number of characters × bits per character.
  • Image: width × height × colour depth (bits).
  • Sound: sample rate × bit depth × seconds (bits).
  • Then convert: ÷ 8 for bytes, ÷ 1024 for KiB, ÷ 1024 again for MiB.
  • Construct an expression means write the calculation with the right numbers and operations. You do not have to work it out.
  • To find how many files fit on a device, divide the capacity by the size of one file (both in the same unit) and round down to a whole number.

How to answer each type of question

Convert between units

1 to 2 marksGrade 5
  1. Decide whether the unit is getting bigger (divide) or smaller (multiply).
  2. Use 8 between bits and bytes, and 1024 for every other step.
  3. Count the steps: bytes to MiB is two steps, so ÷ 1024 ÷ 1024.

Example. (a) State the number of bits in 5 bytes.
(b) Construct an expression to calculate the number of bytes in 6 GiB.

Show the model answerHide the model answer
(a) 40
(1)
(b) 6 × 1024 × 1024 × 1024
(1)

Calculate the total storage needed

3 marksGrade 7
  1. Work out the size of each group of files.
  2. Convert everything to the unit the question asks for.
  3. Add, and give the unit.

Example. A student has 40 photos of 3 MiB each and a video of 1.5 GiB.
Calculate the total storage needed, in MiB. Show your working.

Show the model answerHide the model answer
Photos: 40 × 3 = 120 MiB
(1)
Video: 1.5 × 1024 = 1536 MiB
(1)
Total: 120 + 1536 = 1656 MiB
(1)

Construct an expression for a storage requirement

3 to 4 marksGrade 8
  1. Write the size of one file in bits.
  2. Multiply by the number of files.
  3. Divide by 8, then by 1024 once for each step up to the unit asked for.

Example. An online album stores 500 images. Each image is 1600 × 1200 pixels with a colour depth of 24 bits.
Construct an expression to calculate the storage needed for all the images, in GiB. You do not need to do the calculation.

Show the model answerHide the model answer
1600 × 1200 × 24 (bits for one image) (1) × 500 (1) ÷ 8 (1) ÷ 1024 ÷ 1024 ÷ 1024 (1)

Calculate how many files will fit

2 marksGrade 8
  1. Convert the capacity and the file size to the same unit.
  2. Divide the capacity by the size of one file.
  3. Round down: only complete files count.

Example. A memory card has 2 GiB of free space. Each recording is 96 MiB.
Calculate the number of complete recordings that can be stored. Show your working.

Show the model answerHide the model answer
2 × 1024 = 2048 MiB
(1)
2048 ÷ 96 = 21.3, so 21 complete recordings
(1)

Don’t lose marks

  • Using 1000 instead of 1024 for storage units.
  • Forgetting to divide by 8 to change bits into bytes (the image and sound formulas give bits).
  • Adding sizes that are in different units without converting them first.
  • Rounding up the number of files that fit: 21.3 means 21 complete files, not 22.
  • Multiplying when you should divide: going to a bigger unit makes the number smaller.

More tips

Memory tricks

  • Order of units: 'Big Nosy Bears Kick Muddy Green Tyres' (bit, nibble, byte, KiB, MiB, GiB, TiB).
  • Every step up is ÷ 1024, except bits to bytes, which is ÷ 8.
  • Handy facts: 0.5 MiB = 512 KiB, 0.25 GiB = 256 MiB, 1 KiB = 8192 bits.
  • Sense check: a larger unit always gives a smaller number.

Exam technique

  • In 'construct an expression' questions, keep each stage visible (e.g. × 8, ÷ 1024 ÷ 1024) so each stage can earn its mark.
  • Write the unit next to every number in your working so you can see when you need to convert.
  • Without a calculator, choose methods that keep the numbers simple, e.g. divide by 8 early.

What each grade needs

What you need to be able to do, from the first marks up to the top grade.

  1. Grade 3
    Put the units of storage in orderbit, nibble, byte, kibibyte, mebibyte, gibibyte, tebibyte.
  2. Grade 4
    Recall the size of each unit4 bits = 1 nibble, 8 bits = 1 byte, 1024 bytes = 1 KiB, and each larger unit is 1024 of the one before.
  3. Grade 5
    Convert between unitsDivide by 1024 to go to a larger unit and multiply to go to a smaller one (use 8 between bits and bytes).
  4. Grade 6
    Explain why storage uses multiples of 10241024 = 210, a power of 2, which suits binary computers.
  5. Grade 6
    Construct an expression for a file sizeBuild it stage by stage: size in bits, then ÷ 8, then ÷ 1024 for each unit.
  6. Grade 7
    Calculate the total storage for several filesConvert every size to the same unit before adding or multiplying.
  7. Grade 8
    Solve multi-step storage capacity problemsNumber of files that fit = capacity ÷ size of one file, in the same unit, rounded down.

Quick recall

Cover the answers and test yourself. The app has these as flashcards that come back just before you'd forget them.

State the number of bits in a nibble.
4
Write these units in order of size, starting with the smallest.
gibibyte   byte   tebibyte   mebibyte   kibibyte   nibble
nibble, byte, kibibyte, mebibyte, gibibyte, tebibyte
Convert 3 bytes into bits.
24
State what is meant by the term sample rate in a sound recording.
The number of samples taken each second.
Complete the sentences using words from the box. Each word can be used once.
kibibytes, mebibytes, bytes
One gibibyte is 1024 ………………… .
One mebibyte is 1024 ………………… .
mebibytes; kibibytes
Choose the most suitable unit from the box to measure the storage capacity of a modern smartphone.
byte, kibibyte, mebibyte, gibibyte
gibibyte

Sample questions

Written for this site in the style of Edexcel exam questions. They are not taken from real past papers.

Question 1Easy3 marks
(a) Identify the smallest unit of data.
[1]
  • Byte
  • Nibble
  • Kibibyte
  • Bit
(b) State the number of bits in a nibble.
[1]
(c) State the number of bytes in one kibibyte (KiB).
[1]
Show the answer and mark scheme
(a) Answer: Bit
(b) Answer: 4
  • 4
(c) Answer: 1024
  • 1024
Question 2Medium4 marks
A student’s project folder contains:
  • a report of 768 KiB
  • 12 photos of 2.5 MiB each
  • a video of 1.25 GiB
(a) Calculate the total size of the folder in MiB. Show your working.
[3]
(b) State whether the folder will fit on an empty 1 GiB USB flash drive. Give a reason for your answer.
[1]
Show the answer and mark scheme
(a) Answer: 1310.75 MiB
  • report: 768 ÷ 1024 = 0.75 MiB
  • photos: 12 × 2.5 = 30 MiB and video: 1.25 × 1024 = 1280 MiB
  • total: 1310.75 (MiB)
(b) Answer: No: 1310.75 MiB > 1024 MiB (the video alone is 1.25 GiB).
  • no, because 1310.75 MiB is more than 1 GiB (1024 MiB) / the video alone is larger than 1 GiB
Question 3Hard4 marks
A hard disk drive is sold as '2 TB'. The manufacturer uses 1 TB = 1,000,000,000,000 bytes.
(a) Construct an expression to calculate the capacity of the drive in tebibytes (TiB).
You do not need to do the calculation.
[2]
(b) The value of the expression is about 1.82. Explain why a computer’s operating system may report the capacity of this drive as less than 2.
[2]
Show the answer and mark scheme
(a) Answer: 2,000,000,000,000 ÷ (1024 × 1024 × 1024 × 1024)
  • 2,000,000,000,000 / 2 × 10004 (bytes)
  • ÷ 10244 / ÷ (1024 × 1024 × 1024 × 1024)
(b) Answer: The label uses 1 TB = 1012 bytes; the OS counts in TiB (10244 bytes), which are bigger units, so it shows about 1.82.
  • the manufacturer uses decimal multiples (1 TB = 1012 bytes) but the operating system reports the size in binary multiples (1 TiB = 10244 bytes)
  • a tebibyte is larger than a terabyte, so the same number of bytes is a smaller number of TiB (about 1.82)

More in Data storage and compression

Stuck? Get 1-to-1 help.

Chhetri Academy tutors GCSE and A level Maths and Science online, with a free 30-minute trial lesson.