GCSE · Computer Science · Edexcel · Spec 1CP2
File size and capacity calculations
Paint anything on a tiny grid and the file size won't budge. Why? Soon you'll size any picture, sound or text, and know if it fits.
Computer Science · Data
Paint a picture, then count its bits
This picture is 4 pixels wide and 3 pixels tall, and every pixel stores 2 bits. Pick a colour and repaint any pixels you like. Now look at the stored-data readout: did it move? (Here, 1 kilobyte means 1,000 bytes.)
Scaling up: from pixels and samples to kilobytes and megabytes
A real image, same method as the tiny grid. 600 × 400 is 240,000 pixels, and each pixel stores 16 bits. Multiply the resolution by the colour depth and you've counted every stored bit.
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.
- Will it fit? Put the file size and the free storage in the same unit first, then compare.
Have a goWhich is bigger: a 3,290,000-byte file or a 3.5-megabyte file? Get them into the same unit before you decide.
3.5 megabytes
3,290,000 bytes ÷ 1,000,000 is 3.29 megabytes, which is less than 3.5. The longer-looking number isn't the bigger file once both are in megabytes.
- 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 leaves its file size alone. 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 already 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's 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 sample resolution × sample rate × duration. Divide by 8 for bytes, then by 1,000 for each prefix step up. To compare two sizes, get them into the same unit first.
Key points
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 straight 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?
How do you convert bits to bytes, and bytes to bits?
List the prefixes in ascending order, starting with kilobyte.
How many bytes are in a kilobyte, and in a megabyte?
How many bytes are in a gigabyte, a terabyte and a petabyte?
Text file size: what do you multiply together?
ASCII: bits per character, and size of its character set?
How many bits does Unicode use per character, and what does that buy you?
What is the formula for the size of a bitmap image?
What does colour depth mean?
What is a sample in sound?
What is the difference between sample rate and sample resolution?
What is the formula for the size of a sound file, and which units must you use?
How many hertz are in 1 kilohertz?
A low-resolution image is enlarged to a large size. What does it look like?
What is the quality-versus-file-size trade-off?
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 postedMore Edexcel GCSE Computer Science topics
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 30 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.