1.2.3

Units

Bits to petabytes and calculating file sizes for text, images and sound.

Learning Objectives

  • 1Explain why data must be stored and processed in binary
  • 2Recall the units of data storage, from a bit to a petabyte
  • 3Convert between data storage units
  • 4Calculate the file size of text, image and sound files
  • 5Calculate the storage capacity needed for a given set of files

Why data is stored in binary

Computers are built from millions of tiny electronic switches called transistors. Each switch can only be in one of two states: on or off. Because of this, computers represent everything, numbers, letters, images, sound, using just two digits: 0 and 1. This is called binary. A single 0 or 1 is called a bit.
Computers are built from transistors that can only be on or off, so all data must be represented using just two values: 0 and 1. This is binary. Every type of data, numbers, text, images and sound, is ultimately converted into and stored as binary so it can be processed by the CPU. A single binary digit (0 or 1) is called a bit.
Data must be stored and processed in binary because computer hardware is built from transistors with only two reliable states: on and off. Any data a computer works with, whole numbers, text, images, sound, must therefore be converted into a binary format before it can be stored or processed. A single binary digit is a bit, the smallest unit of data.

Think of it like...

Think of a light switch: it can only be up or down, never in between. A computer's memory is made of billions of these "switches", so everything it stores has to be spelled out using just two symbols, 0 and 1.

Units of data storage

Data storage is measured in units built up from the bit. A nibble is 4 bits, and a byte is 8 bits (2 nibbles). Bytes are then grouped into bigger units: kilobyte, megabyte, gigabyte, terabyte and petabyte. Each unit is 1,000 times bigger than the one before it. OCR also accepts 1,024 if you prefer to use it, either is fine.
UnitSize
BitA single 0 or 1
Nibble4 bits
Byte8 bits
Kilobyte (KB)1,000 bytes
Megabyte (MB)1,000 KB
Gigabyte (GB)1,000 MB
Terabyte (TB)1,000 GB
Petabyte (PB)1,000 TB
Units of data storage build up from the bit: a nibble is 4 bits, and a byte is 8 bits. From there, each unit is 1,000 times the one before it: kilobyte, megabyte, gigabyte, terabyte, petabyte. OCR accepts 1,024 as an alternative in conversions and calculations, so either is credited as long as you are consistent.
UnitSize
BitA single 0 or 1
Nibble4 bits
Byte8 bits
Kilobyte (KB)1,000 bytes
Megabyte (MB)1,000 KB
Gigabyte (GB)1,000 MB
Terabyte (TB)1,000 GB
Petabyte (PB)1,000 TB
The unit hierarchy runs bit → nibble (4 bits) → byte (8 bits) → kilobyte → megabyte → gigabyte → terabyte → petabyte, with each step a factor of 1,000 above the last (OCR also accepts 1,024 for conversions and calculations). Being able to convert fluently between units, and to compare quantities given in different units, is essential for capacity questions.
Bit1 binary digitNibble4 bitsByte8 bitsKilobyte1,000 bytesMegabyte1,000 KBGigabyte1,000 MBTerabyte1,000 GBPetabyte1,000 TB

Calculating file size: sound

A sound file is recorded by taking samples of the sound many times per second. To work out its file size, use: sound file size = sample rate × duration (s) × bit depth. The sample rate is how many samples are taken per second, the duration is how long the recording is in seconds, and the bit depth is how many bits are used per sample.
Sound file size is calculated as: sample rate × duration (s) × bit depth. Sample rate is the number of samples taken per second (in Hz), duration is the length of the recording in seconds, and bit depth is the number of bits used to store each sample. Increasing any of these three increases both the file size and the quality/accuracy of the recording.
Sound file size (bits) = sample rate × duration (s) × bit depth. Each factor trades file size against audio quality: a higher sample rate captures the waveform more accurately, and a higher bit depth allows more precise amplitude values per sample, at the cost of a larger file.

Think of it like...

Imagine photographing a wave crashing on a beach. Taking more photos per second (sample rate) and using a higher-resolution camera each time (bit depth) both give you a more accurate record, but also more data to store.

Calculating file size: images

A digital image is made of a grid of pixels. To work out its file size, use: image file size = colour depth × image height (px) × image width (px). Colour depth is the number of bits used to store the colour of each pixel, and height/width are measured in pixels.
Image file size is calculated as: colour depth × image height (px) × image width (px). Colour depth is the number of bits used to represent the colour of a single pixel; a higher colour depth allows more possible colours per pixel but increases the file size.
Image file size (bits) = colour depth × height (px) × width (px). Height × width gives the total pixel count; multiplying by colour depth (bits per pixel) gives the total bits needed to store every pixel's colour.

Calculating file size: text

A text file's size depends on how many characters it contains and how many bits are used to represent each character. Use: text file size = bits per character × number of characters.
Text file size is calculated as: bits per character × number of characters. The number of bits per character depends on the character set used to encode the text (covered in Data storage).
Text file size (bits) = bits per character × number of characters. This is the simplest of the three file-size formulas, but questions often combine it with a unit conversion, so the final answer must be converted from bits into the unit asked for (e.g. bytes or KB).

Calculating storage capacity requirements

Every storage device has a fixed capacity, a USB stick might hold 32GB, a laptop's SSD might hold 512GB, and different devices hold different amounts. Exam questions often ask whether a set of files will fit on a given device. To answer this: work out the total size of all the files (adding them together, making sure they are all in the same unit), then compare that total to the device's capacity.
Storage devices each have a fixed capacity (e.g. a 64GB memory card, a 2TB hard drive), and you need to check whether a given set of files fits within that fixed limit. To do this: find each file's size, convert every value to the same unit, add them together, and compare the total to the device's capacity. A very common error is comparing values that are still in different units (e.g. comparing MB directly to KB without converting first).
Every storage device has a fixed capacity that ultimately limits how much data it can hold. Capacity questions require converting every file size to a common unit before summing, then comparing against the device's stated capacity. Show your working at each conversion step: OCR's mark schemes award partial credit for correct intermediate steps (e.g. correctly multiplying two of the three values) even if a later step or the final conversion is wrong.
Calculating file sizeSound file sizeSample rate × duration× bit depthSamples per second, seconds,and bits per sampleWorked example44 100 × 10 s × 16= 7 056 000 bits= 882 000 bytesImage file sizeColour depth × height× widthBits per pixel, then thetotal number of pixelsWorked example24 × 100 × 200= 480 000 bits= 60 000 bytesText file sizeBits per character× number of charactersDepends on which characterset the text usesWorked example8 × 500 characters= 4 000 bits= 500 bytes

Exam Phrasing: Use These Exact Phrases

  • ✓Computers use binary (0s and 1s) because their hardware is built from switches that are either on or off
  • ✓A bit is a single binary digit; a nibble is 4 bits; a byte is 8 bits
  • ✓Each unit from kilobyte upwards is 1,000 times the unit before it
  • ✓Sound file size = sample rate x duration (s) x bit depth
  • ✓Image file size = colour depth x image height (px) x image width (px)
  • ✓Text file size = bits per character x number of characters
  • ✓Convert all values to the same unit before adding or comparing them
  • 💡Learn all three file size formulas exactly: sound (sample rate × duration × bit depth), image (colour depth × height × width), text (bits per character × number of characters).
  • 💡Always check what unit the question wants the answer in, you may need to convert your result from bits to bytes, KB, MB, etc.
  • 💡You may use 1,000 or 1,024 for conversions, OCR credits both. Pick one and stay consistent within the question.
  • 💡Questions may allow you to add an allowance for metadata (e.g. 10% on top of an image file size). OCR credits this in both the working and the final answer, so it is safe to include if the question mentions metadata.
  • 💡Examiners are told that not all of the working has to be correct to earn the working mark, so always write your steps down even if you are unsure of the final answer.
  • 💡Show every step of a calculation. Partial marks are given for correct working even if you make an error later on, don't just write the final answer.
  • 💡When comparing storage sizes given in different units (e.g. 300MB vs 200,000KB), convert them to the same unit first before deciding which is bigger or smaller.

Wrong:

Comparing 300MB and 200,000KB without converting first

Right:

Convert both to the same unit first: 300MB = 300,000KB, so 300MB is larger than 200,000KB

Why it matters: OCR examiners noted candidates frequently picked the wrong answer when values were given in different units, this is a very common trap.

Wrong:

A byte is 4 bits

Right:

A nibble is 4 bits; a byte is 8 bits

Why it matters: Mixing up nibble and byte is a common slip, remember: byte = 8 bits (2 nibbles).

Wrong:

Only writing the final answer to a calculation question

Right:

Show each step of the calculation clearly

Why it matters: Marks are often available for correct working (e.g. correctly multiplying two of the values), even if the final answer is wrong.

Question:

A sound file is recorded with a sample rate of 44,100Hz, a duration of 3 seconds, and a bit depth of 16 bits. Calculate the file size in bits. [2]

💡 Attempt this before revealing the answer, practice makes perfect!

Model Answer:

File size = sample rate x duration x bit depth = 44,100 x 3 x 16 = 2,116,800 bits.

Mark Scheme:

  • 1Correct method: sample rate x duration x bit depth
  • 2Correct final answer: 2,116,800 bits (accept correct working shown even if the final figure is wrong)

Calculate the size of an image, sound or text file in bits.

Loading a question…

Questions are generated fresh every time, so you can keep practising as long as you want.

Tap a card to flip it. Use the arrow keys to move and space to flip.

Known 0 Still learning 0
1 / 12

Exam-style questions. Have a go, then reveal the mark scheme to check your answer.

1.State how many bits are in a byte.

[1]

2.Explain why computers store and process data in binary.

[2]

3.A text file contains 500 characters, using 8 bits per character. Calculate the file size in bytes.

[2]

4.An image is 200 pixels wide and 100 pixels high, with a colour depth of 8 bits. Calculate the file size in bits.

[2]

5.A student has three files: 250MB, 900,000KB, and 1.2GB. State which file is the largest, showing your working.

[3]

6.A sound file is recorded with a sample rate of 20,000Hz, a bit depth of 8 bits and a duration of 30 seconds. Calculate the size of the file in megabytes.

[3]

7.A memory card has a capacity of 2GB. A user wants to store 300 photos, each 4MB, and 12 videos, each 90MB. Determine whether all of these files will fit on the card, showing your working.

[4]

8.A podcaster is choosing the sample rate and bit depth for recording an episode. Discuss the factors they should consider and the trade-offs involved.

[8]

Extended response · marked in levels, not by counting points

The examiners' reports are the most useful and least read of the three: they say what candidates actually got wrong each year. All files are hosted by OCR.

Past-paper questions grouped by topic

The same OCR questions, sorted by topic rather than by year (via Physics & Maths Tutor).

2024
Paper 1

On a storage capacity comparison question, candidates often struggled when the values were given in different units. Many picked the wrong answer (e.g. 300MB instead of 200,000KB) because they compared the numbers directly instead of converting to a common unit first.

Paper 1

On a file size calculation question, examiners awarded marks for correct partial working, for example correctly multiplying two of the three required values, even when a later step in the calculation was wrong. Always show your working.