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)
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
- Width = 640 pixels
- Height = 480 pixels
- Colour depth = 24 bits per pixel
Remember: 8 bits = 1 byte
Or approximately 922 KB
Final Answer
The image file size is 0.92 MB (or 922 KB)
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
Total pixels = 1920 × 1080 = 2,073,600 pixels
Size in bits = 2,073,600 × 32 = 66,355,200 bits
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
Round down since you can't store a partial photo
Final Answer
The memory card can store 241 photos
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
Size = 44,100 × 4,440 × 16 × 2
Size = 6,273,792,000 bits
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.
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
Notice: With 8 bits per character, bytes = characters!
Final Answers
a) 15,000 bytes
b) 15 KB
Unit Conversion Chain
Question
Convert 3.5 GB into:
- a) Megabytes (MB)
- b) Kilobytes (KB)
- c) Bytes
- d) Bits
Solution
Multiply by 1,000 when going to smaller units
Or 3.5 × 109 bytes in scientific notation
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
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
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
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
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
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