← Back to Data Units

Worked Examples: File Size Calculations

Step-by-step solutions to common calculation problems

Formula Reference

Image File Size

Width × Height × Colour Depth

Result in bits - divide by 8 for bytes

Sound File Size

Sample Rate × Duration × Bit Depth

× 2 for stereo - result in bits

Text File Size

Characters × Bits per Character

Usually 8 bits per character (ASCII)

Example 1 Foundation

Image File Size - Basic

Question

Calculate the file size of an image that is 640 × 480 pixels with a colour depth of 24 bits. Give your answer in megabytes (MB).

Solution

1 Identify what we know
  • Width = 640 pixels
  • Height = 480 pixels
  • Colour depth = 24 bits per pixel
2 Write the formula
File size (bits) = Width × Height × Colour depth
3 Calculate total pixels
Total pixels = 640 × 480 = 307,200 pixels
4 Calculate size in bits
Size = 307,200 × 24 = 7,372,800 bits
5 Convert bits to bytes
Size = 7,372,800 ÷ 8 = 921,600 bytes

Remember: 8 bits = 1 byte

6 Convert to megabytes
Size = 921,600 ÷ 1,000,000 = 0.92 MB

Or approximately 922 KB

Final Answer

The image file size is 0.92 MB (or 922 KB)

Example 2 Core

Image File Size - HD Resolution

Question

A digital camera takes photos at 1920 × 1080 pixels (Full HD) with 32-bit colour (including transparency). How many photos can fit on a 2 GB memory card?

Solution

1 Calculate size of one photo

Total pixels = 1920 × 1080 = 2,073,600 pixels

Size in bits = 2,073,600 × 32 = 66,355,200 bits

2 Convert to bytes and MB

Size in bytes = 66,355,200 ÷ 8 = 8,294,400 bytes

Size in MB = 8,294,400 ÷ 1,000,000 = 8.29 MB per photo

3 Convert card capacity to MB
2 GB = 2 × 1,000 = 2,000 MB
4 Calculate number of photos
Number of photos = 2,000 ÷ 8.29 = 241.25

Round down since you can't store a partial photo

Final Answer

The memory card can store 241 photos

Example 3 Core

Audio File Size - CD Quality

Question

An audio CD contains 74 minutes of stereo music recorded at:

  • Sample rate: 44,100 Hz
  • Bit depth: 16 bits
  • Channels: 2 (stereo)

Calculate the total data capacity of the CD in MB.

Solution

1 Convert duration to seconds
Duration = 74 × 60 = 4,440 seconds
2 Write the formula
Size = Sample rate × Duration × Bit depth × Channels
3 Substitute values

Size = 44,100 × 4,440 × 16 × 2

Size = 6,273,792,000 bits

4 Convert to bytes
Size = 6,273,792,000 ÷ 8 = 784,224,000 bytes
5 Convert to MB
Size = 784,224,000 ÷ 1,000,000 = 784.2 MB

Final Answer

The CD can store approximately 784 MB of audio data

This is close to the standard CD capacity of ~700 MB, accounting for some error correction data.

Example 4 Foundation

Text File Size

Question

A plain text document contains 15,000 characters (including spaces and punctuation). Using ASCII encoding (8 bits per character), calculate the file size in:

  • a) Bytes
  • b) Kilobytes (KB)

Solution

1 Calculate size in bits
Size = 15,000 × 8 = 120,000 bits
2 Part (a): Convert to bytes
Size = 120,000 ÷ 8 = 15,000 bytes

Notice: With 8 bits per character, bytes = characters!

3 Part (b): Convert to KB
Size = 15,000 ÷ 1,000 = 15 KB

Final Answers

a) 15,000 bytes

b) 15 KB

Example 5 Core

Unit Conversion Chain

Question

Convert 3.5 GB into:

  • a) Megabytes (MB)
  • b) Kilobytes (KB)
  • c) Bytes
  • d) Bits

Solution

1 Part (a): GB to MB
3.5 GB × 1,000 = 3,500 MB

Multiply by 1,000 when going to smaller units

2 Part (b): MB to KB
3,500 MB × 1,000 = 3,500,000 KB
3 Part (c): KB to Bytes
3,500,000 KB × 1,000 = 3,500,000,000 bytes

Or 3.5 × 109 bytes in scientific notation

4 Part (d): Bytes to Bits
3,500,000,000 bytes × 8 = 28,000,000,000 bits

Or 28 × 109 bits = 28 Gb (gigabits)

Final Answers

a) 3,500 MB

b) 3,500,000 KB

c) 3,500,000,000 bytes

d) 28,000,000,000 bits

Example 6 Extension

Complex Scenario - Storage Planning

Question

A video production company needs storage for a project containing:

  • 200 images at 4000 × 3000 pixels, 24-bit colour
  • 30 minutes of uncompressed audio (48,000 Hz, 24-bit, stereo)
  • A 50,000 word script (average 6 characters per word, ASCII)

What is the minimum hard drive size needed (in GB)?

Solution

1 Calculate image storage

Per image = 4000 × 3000 × 24 = 288,000,000 bits

Per image = 288,000,000 ÷ 8 = 36,000,000 bytes = 36 MB

Total images = 36 × 200 = 7,200 MB

2 Calculate audio storage

Duration = 30 × 60 = 1,800 seconds

Size = 48,000 × 1,800 × 24 × 2 = 4,147,200,000 bits

Size = 4,147,200,000 ÷ 8 = 518,400,000 bytes

Size = 518.4 MB

3 Calculate script storage

Total characters = 50,000 × 6 = 300,000 characters

Size = 300,000 × 8 = 2,400,000 bits

Size = 2,400,000 ÷ 8 = 300,000 bytes = 0.3 MB

4 Calculate total

Total = 7,200 + 518.4 + 0.3 = 7,718.7 MB

In GB = 7,718.7 ÷ 1,000 = 7.72 GB

Final Answer

Minimum storage needed: 8 GB (rounding up to next practical size)

In practice, you'd want more space for working files and future additions - a 16 GB or 32 GB drive would be advisable.

Try These Yourself

Problem 1

Calculate the file size of a 1024 × 768 image with 8-bit colour depth. Give your answer in KB.

Problem 2

A 5-minute mono audio file is recorded at 22,050 Hz with 8-bit depth. What is the file size in MB?

Problem 3

Convert 2,500,000 bytes into: a) KB, b) MB, c) bits