How do we measure amounts of data, and how does compression make files smaller?
Use units of storage from bit to terabyte, and explain lossless and lossy compression and why files are compressed
A focused answer to the O-Level Computing point on data measurement. Units from bit and byte up to terabyte, calculating file sizes, and the difference between lossless and lossy compression and why files are compressed.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to use the units that measure amounts of data, from the bit up to the terabyte, to work out simple file sizes, and to explain compression: what lossless and lossy compression are, how they differ, and why files are compressed at all. The central idea is that all storage is measured in multiples of the byte, and compression trades some combination of detail or processing for a smaller file.
The answer
Units of storage
The smallest unit is the bit (one binary digit). Eight bits make a byte. Above the byte, each unit is about times the one below it (using the common decimal convention):
| Unit | Symbol | Approximate size |
|---|---|---|
| bit | b | a single or |
| byte | B | bits |
| kilobyte | KB | about bytes |
| megabyte | MB | about KB |
| gigabyte | GB | about MB |
| terabyte | TB | about GB |
Strictly, computers count in powers of two, so bytes, but at O-Level the round figure of is accepted unless a question says otherwise.
Calculating a simple file size
To estimate a file size, work out the total bits and convert to bytes. For an image, multiply the number of pixels by the colour depth:
total bits = number of items x bits per item
total bytes = total bits / 8
Why we compress files
Compression makes a file smaller. This saves storage space, speeds up transfer over a network (less data to send), and uses less bandwidth, which matters for streaming, email attachments and web pages.
Lossless compression
Lossless compression reduces the size without losing any data, so the original file can be restored exactly. It works by storing information more efficiently, for example recording a repeated pattern once with a count. It is used where every bit matters: text documents, spreadsheets, program code and some image formats.
Lossy compression
Lossy compression achieves much smaller files by permanently removing detail that a person is unlikely to notice, such as subtle colours in a photo or sounds the ear cannot easily hear. The original cannot be fully restored. It is used for photos, music and video, where a small loss of quality is an acceptable price for a much smaller file.
Examples in context
Example 1. Streaming a video. A streaming service uses lossy compression so a film fits the viewer's internet speed. The picture loses a little fine detail, but it can be sent smoothly in real time, which would be impossible with the full uncompressed data.
Example 2. Zipping a folder of documents. A student zips a folder of reports and code before emailing it. The zip uses lossless compression, so when the recipient unzips it, every document and line of code is restored exactly, with nothing lost.
Try this
Q1. State how many bytes are in one megabyte, using the decimal convention. [2 marks]
- Cue. About kilobytes, so about bytes.
Q2. Give two reasons a website might compress its images. [2 marks]
- Cue. Smaller files load faster for users and use less bandwidth and storage.
Q3. A file must be restored to its exact original after transfer. State which type of compression must be used and why. [2 marks]
- Cue. Lossless, because it loses no data and so the original can be rebuilt exactly.
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original4 marks(a) Place these units of storage in order from smallest to largest: megabyte, bit, gigabyte, byte, kilobyte. (b) State how many bits are in one byte, and roughly how many bytes are in one kilobyte.Show worked answer →
(a) From smallest to largest: bit, byte, kilobyte, megabyte, gigabyte. Each step up is about times larger than the one before (using the common decimal convention).
(b) One byte is bits. One kilobyte is about bytes (more precisely bytes when measured in powers of two, but is accepted at this level).
Markers reward the correct order, bits per byte, and roughly bytes per kilobyte.
Original5 marksA photographer must email a photo but the limit is . (a) Explain the difference between lossless and lossy compression. (b) Recommend which type suits this situation and give one reason. (c) State one situation where lossless compression should be used instead.Show worked answer →
(a) Lossless compression makes a file smaller without losing any data, so the original can be restored exactly (for example by storing repeated patterns once). Lossy compression makes a file much smaller by permanently removing some detail the eye or ear is unlikely to notice; the original cannot be fully restored.
(b) Lossy compression suits the photo. It can shrink a image well below , and a small loss of fine detail is acceptable for an emailed photo.
(c) Lossless should be used where every bit matters, such as a text document, a spreadsheet, program code, or a medical or legal image, where losing any data would be unacceptable.
Markers reward the lossless-versus-lossy distinction, lossy for the photo with a reason, and a valid lossless case such as text or program files.
Related dot points
- Explain why computers use binary, describe place value in binary and hexadecimal, and state why hexadecimal is used as shorthand for binary
A focused answer to the O-Level Computing point on number systems. Why computers use binary, place value in binary and hexadecimal, the meaning of bits and bytes, and why hexadecimal is a compact shorthand for binary.
- Convert whole numbers between denary, binary and hexadecimal using place value, repeated division and nibble grouping
A focused answer to the O-Level Computing point on number base conversion. Converting between denary, binary and hexadecimal using place value, repeated division by two, and grouping binary into nibbles.
- Explain how text (ASCII), sound (sampling) and images (pixels and colour depth) are represented as binary in a computer
A focused answer to the O-Level Computing point on representing data. How text uses character codes such as ASCII, how sound is sampled, and how images are stored as pixels with a colour depth, all as binary.
- Perform binary addition showing carries, and explain overflow when a result exceeds the fixed width of a register
A focused answer to the O-Level Computing point on binary addition. Adding binary numbers column by column with carries, checking the result against denary, and understanding overflow in a fixed-width register.
- Distinguish RAM, ROM and secondary storage, explaining volatility and the purpose of each in a computer
A focused answer to the O-Level Computing point on memory and storage. The difference between RAM and ROM, what volatile means, the role of secondary storage, and why a computer needs all three.