GCSE · Computer Science · Edexcel · Spec 1CP2

File size and capacity calculations

Paint anything you like on a tiny grid and the file size won't budge. Why? By the end you'll size a picture, a sound or a text from scratch.

Computer Science · Data

Paint a picture, then count its bits

4 × 3 pixels · 2-bit

4 by 3 pixel grid, 2 bits per pixel, 4 colours. Stored data: 24 bit

Paint
Colours4Bit depth2-bitStored data24 bit
pick a colour, then paint

This picture is 4 pixels wide and 3 pixels tall, and every pixel stores 2 bits. Pick a colour, repaint any pixels you like, and keep an eye on the stored-data readout. Here, 1 kilobyte means 1,000 bytes.

Watch out: Colour depth means bits per pixel. Raise it to 3 and every one of the 12 pixels stores an extra bit: 12 × 3 = 36 bits instead of 12 × 2 = 24. More quality, more bits.

Scaling up: from pixels and samples to kilobytes and megabytes

600 × 400 × 16 = 3,840,000 bits

A real image, same method as the tiny one. 600 × 400 is 240,000 pixels, and each pixel stores 16 bits. Multiply the resolution by the colour depth and you have counted every stored bit.

1 / 6

Encoding the same text

ASCIIvsUnicode

Text size is characters × bits per character. Only the bits per character change here.

Focus

Bits per character

ASCII

7 bits

Unicode

16 or 32 bits, depending on the version

The insight

This is the number that gets multiplied by the character count, so everything else follows from it.

Size of a 30-character text

ASCII

7 × 30 = 210 bits

Unicode

32-bit: 32 × 30 = 960 bits, which is 4 bytes per character, or 120 bytes. 16-bit: 2 bytes per character.

Characters it can represent

ASCII

A small character set: 128 characters

Unicode

A much wider range, including emoji

What you get overall

ASCII

Smaller text files, but a limited set of characters

Unicode

Larger text files, but a far wider range of characters

Computer Science · Images

Which of these do you believe?

A photo is stored as a bitmap. On a web page it is shown much smaller than it really is.

Which idea is closest to what you think right now?
How sure are you?

Computer Science · Capacity

Will it fit?

A video file is 48,800,000,000 bits. A device has 5 gigabytes of free storage. Does the file fit? (1 gigabyte is one billion bytes.)

  1. The file is in bits. The storage is in gigabytes. They are in different units, so we can't compare them yet.
  2. missing step
Which line is step 2?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Count the bits, convert the units, and check whether it fits.

What you need to know

  • File size measures how much binary data a file contains. A byte is 8 bits.
  • Bits to bytes: divide by 8. Bytes to bits: multiply by 8.
  • Have a goYour mate swears a 40-bit message is '40 bytes, same number, different label'. How many bytes is it really?

    5 bytes

    A byte is 8 bits, so going from bits to bytes means dividing by 8 (40 ÷ 8 = 5), not just swapping the label.

  • Prefixes climb in thousands: 1 kilobyte is 1,000 bytes, 1 megabyte is 1,000,000 bytes, 1 gigabyte is one billion bytes.
  • To see whether a file fits, convert the file size and the storage to the same unit first.
  • Text size is characters × bits per character. ASCII uses 7 bits; Unicode uses 16 or 32, depending on the version.
  • Bitmap size is resolution (width × height, in pixels) × colour depth (bits per pixel).
  • Have a goA tiny picture is 10 pixels wide and 5 pixels tall, at 3 bits per pixel. How many bits does it store?

    150 bits

    Multiply the resolution (10 × 5 = 50 pixels) by the colour depth of 3. Adding the numbers would forget that every pixel stores 3 bits.

  • Showing an image smaller on screen does not change its file size. A low-resolution image enlarged looks pixelated.
  • Sound is stored as samples. Sample rate is samples per second, in hertz. Sample resolution is bits per sample.
  • Sound size is sample resolution × sample rate × duration, with the rate in hertz and the time in seconds.
  • Have a goA clip is sampled 100 times a second for 10 seconds, using 8 bits for each sample. How many bits does it store?

    8,000 bits

    Sample resolution × sample rate × duration is 8 × 100 × 10. The rate is in hertz and the time in seconds, so nothing needs converting.

  • Raising resolution, colour depth, sample rate or sample resolution improves quality but makes the file bigger. That is the trade-off.

The big picture

File size is a count of bits. Multiply what is stored: characters × bits per character, pixels × colour depth, or bits per sample × samples per second × seconds. Divide by 8 for bytes, then by 1,000 for each prefix step up. To compare sizes, get them into the same unit first.

Key points

1File size counts bits. Multiply the stored choices to get the total: characters × bits per character, pixels × colour depth, or sample resolution × sample rate × duration.
2Bits to bytes is ÷ 8. Each step up the prefix ladder (kilobyte, megabyte, gigabyte, terabyte, petabyte) is a multiple of a thousand here.
3Convert to the same unit before comparing a file with the storage available, and use hertz and seconds in the sound formula.
4Higher resolution, colour depth, sample rate or sample resolution means better quality and a bigger file. The image's display size is not part of the calculation.

Worked example

Problem

A sound clip lasts 30 seconds. It is sampled at 1 kilohertz with 4 bits per sample. Find its file size in bits, bytes and kilobytes. (1 kilobyte is 1,000 bytes.)

⚠ Watch out

Comparing numbers in different units, such as a file in bits against storage in gigabytes. The sound formula has the same trap: minutes or kilohertz fed in without converting to seconds and hertz.

🧠

Memory hook

Multiply to count the bits. Divide by 8 for bytes. Divide by 1,000 for every prefix step up.

✓

Check yourself

In your own words, explain why showing a picture smaller on screen does not make its file smaller, and name two things that would make a bitmap's file bigger.

Flashcards

(16)
How many bits are in a byte?
8 bits.
How do you convert bits to bytes, and bytes to bits?
Bits to bytes: divide by 8. Bytes to bits: multiply by 8.
List the prefixes in ascending order, starting with kilobyte.
Kilobyte, megabyte, gigabyte, terabyte, petabyte.
How many bytes are in a kilobyte, and in a megabyte?
1,000 bytes in a kilobyte; 1,000,000 bytes in a megabyte.
How many bytes are in a gigabyte, a terabyte and a petabyte?
A gigabyte is one billion bytes, a terabyte one trillion bytes, a petabyte one quadrillion bytes.
Text file size: what do you multiply together?
Number of characters × bits per character.
ASCII: bits per character, and size of its character set?
7 bits, and a small set of 128 characters.
How many bits does Unicode use per character, and what does that buy you?
16 or 32 bits, depending on the version. Larger files, but a much wider range of characters, including emoji.
What is the formula for the size of a bitmap image?
Resolution (width × height, the number of pixels) × colour depth (bits per pixel).
What does colour depth mean?
The number of bits used for each pixel.
What is a sample in sound?
A measurement of a physical property taken at a point in time.
What is the difference between sample rate and sample resolution?
Sample rate is the number of samples per second, in hertz. Sample resolution is the number of bits used for each sample.
What is the formula for the size of a sound file, and which units must you use?
Sample resolution × sample rate × duration, with the rate in hertz and the duration in seconds.
How many hertz are in 1 kilohertz?
1,000 hertz.
A low-resolution image is enlarged to a large size. What does it look like?
Pixelated.
What is the quality-versus-file-size trade-off?
Higher resolution, colour depth, sample rate or sample resolution gives better quality but a larger file, so you balance the two for the job.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 9 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.