← Back to Topics

Data Units & Capacity

Understanding how data is measured and calculated

What You'll Learn

🔢

Binary Data

Why computers store everything as 0s and 1s

📏

Units of Storage

From bits to petabytes - measuring data

🔄

Unit Conversion

Converting between different data units

🧮

File Size Calculations

Calculate sizes for images, sound, and text

Why Computers Use Binary

Everything is Binary

Computers can only understand two states: ON (1) or OFF (0). This is called binary.

All data - text, images, videos, music, games - must be converted to binary (0s and 1s) before a computer can process, store, or transmit it.

Why Binary Works

  • Simple circuits - Easy to build with transistors (on/off switches)
  • Reliable - Only 2 states means less chance of errors
  • Fast switching - Transistors can switch billions of times per second
  • Universal - Any data can be represented as numbers

Real-World Analogy

Think of Morse code - it uses just dots and dashes to represent any message. Binary is similar, but uses 0s and 1s instead.

Light switch: OFF = 0, ON = 1

Units of Data Storage

Data is measured in specific units. The smallest unit is a bit, and we group bits together to make larger, more practical units.

Unit Symbol Size Example Use
Bit b Single 0 or 1 The smallest unit of data
Nibble - 4 bits One hexadecimal digit (0-F)
Byte B 8 bits One character (letter, number, symbol)
Kilobyte KB 1,000 bytes A short email or text document
Megabyte MB 1,000 KB An MP3 song (3-5 MB)
Gigabyte GB 1,000 MB A movie or large game
Terabyte TB 1,000 GB Hard drive capacity
Petabyte PB 1,000 TB Data centres, cloud storage

Key Pattern

Each unit is 1,000 times larger than the previous one (using decimal/SI units).

Note: Some systems use 1,024 (binary) instead of 1,000. Both are acceptable in exams.

Visualising Data Units

PB 1,000,000,000,000,000 bytes
TB 1,000,000,000,000 bytes
GB 1,000,000,000 bytes
MB 1,000,000 bytes
KB 1,000 bytes
B 8 bits
bit 1 or 0

Converting Between Units

Going UP (smaller to larger)

Divide by 1,000

5,000 KB ÷ 1,000 = 5 MB

2,500,000 bytes ÷ 1,000 ÷ 1,000 = 2.5 MB

Going DOWN (larger to smaller)

Multiply by 1,000

3 GB × 1,000 = 3,000 MB

1.5 TB × 1,000 × 1,000 = 1,500,000 MB

Try It: Unit Converter

=
1

Calculating File Sizes

You need to know how to calculate the file size for different types of data. Each type has its own formula.

Image File Size

Image Size (bits) = Width (px) × Height (px) × Colour Depth (bits)
Width × Height = Total number of pixels in the image
Colour Depth = Number of bits used to represent each pixel's colour
  • 1 bit = 2 colours (black & white)
  • 8 bits = 256 colours
  • 24 bits = 16.7 million colours (true colour)
  • 32 bits = 16.7 million colours + transparency

Example: Calculate the file size of an image

An image is 1920 × 1080 pixels with 24-bit colour depth.

1 Total pixels = 1920 × 1080 = 2,073,600 pixels
2 Size in bits = 2,073,600 × 24 = 49,766,400 bits
3 Size in bytes = 49,766,400 ÷ 8 = 6,220,800 bytes
4 Size in MB = 6,220,800 ÷ 1,000,000 = 6.22 MB

Sound File Size

Sound Size (bits) = Sample Rate (Hz) × Duration (s) × Bit Depth
Sample Rate = How many samples taken per second (Hz)
  • 8,000 Hz = Phone quality
  • 44,100 Hz = CD quality
  • 48,000 Hz = DVD/professional quality
Duration = Length of the audio in seconds
Bit Depth = Bits per sample (quality of each sample)
  • 8-bit = Basic quality
  • 16-bit = CD quality
  • 24-bit = Professional quality
Note: For stereo audio, multiply by 2 (two channels).

Example: Calculate the file size of an audio clip

A 3-minute stereo audio clip at CD quality (44,100 Hz, 16-bit).

1 Duration in seconds = 3 × 60 = 180 seconds
2 Size in bits = 44,100 × 180 × 16 = 127,008,000 bits
3 For stereo = 127,008,000 × 2 = 254,016,000 bits
4 Size in bytes = 254,016,000 ÷ 8 = 31,752,000 bytes
5 Size in MB = 31,752,000 ÷ 1,000,000 = 31.75 MB

Text File Size

Text Size (bits) = Number of Characters × Bits per Character
Number of Characters = Total characters including spaces and punctuation
Bits per Character = Depends on encoding:
  • ASCII = 7 or 8 bits (128 or 256 characters)
  • Unicode (UTF-8) = 8-32 bits (supports all languages)
  • Common assumption: 8 bits (1 byte) per character

Example: Calculate the file size of a text document

A document contains 5,000 characters using ASCII encoding (8 bits per character).

1 Size in bits = 5,000 × 8 = 40,000 bits
2 Size in bytes = 40,000 ÷ 8 = 5,000 bytes
3 Size in KB = 5,000 ÷ 1,000 = 5 KB

Calculating Storage Requirements

When planning storage, you need to calculate the total capacity required for all your files.

Example: Planning a photo storage device

A photographer needs to store 500 photos. Each photo is 4000 × 3000 pixels with 24-bit colour.

1 Size per image = 4000 × 3000 × 24 = 288,000,000 bits
2 In bytes = 288,000,000 ÷ 8 = 36,000,000 bytes = 36 MB per photo
3 Total for 500 photos = 36 × 500 = 18,000 MB = 18 GB
✓ Recommendation: 32 GB SD card (allows room for more)

Exam Tips

  • Always show your working - you get marks for method even if the final answer is wrong
  • Convert to the unit asked for in the question
  • Remember: 8 bits = 1 byte (divide by 8 to go from bits to bytes)
  • Use 1,000 for conversions (or 1,024 if specified)
  • Don't forget stereo = ×2 for audio files

Quick Reference

Unit Conversions

  • 8 bits = 1 byte
  • 1,000 bytes = 1 KB
  • 1,000 KB = 1 MB
  • 1,000 MB = 1 GB
  • 1,000 GB = 1 TB
  • 1,000 TB = 1 PB

File Size Formulas

  • Image: W × H × colour depth
  • Sound: sample rate × duration × bit depth
  • Text: characters × bits per char

Common Values

  • CD audio: 44,100 Hz, 16-bit
  • True colour: 24-bit depth
  • ASCII text: 8 bits/char
  • HD image: 1920 × 1080

Practice Activities