How Much Space Data Takes
Working out a file size
Work out how many bytes a picture, a piece of text or a recording takes up, from how many things are in it and how many bytes one of those things needs.
A computer stores everything in bytes, whatever the thing is. So the size of any file comes from two questions, and never from more than two. How many separate things does the file hold? And how many bytes does one of those things take? Multiply the answers together and you have the size. What changes from one kind of file to another is only what the things are: characters in a piece of text, pixels in a picture, samples in a recording.
How many, times how big
A picture's how-many is not written down for you: it is the width multiplied by the height, because that is how many pixels a rectangle of that shape holds. A recording's how-many is the samples in one second multiplied by the number of seconds. Get the how-many right first and the rest is one more multiplication. Getting it wrong is almost always the same mistake — using the width and the height as if they were the answer rather than as if they were the way to it.
Worked example
A picture is 10 pixels wide and 6 pixels tall, and stores 4 bytes for every pixel. How many bytes is it?
How many pixels? 10 × 6 = 60.
Six rows of ten pixels each. This is the step that is not written in the question.
Try it together
A page of a book holds 25 lines, each line holds 80 characters, and each character takes one byte.
Find the how-many first, then the bytes, then scale it up.
1.How many characters are there on one page?
Have a go
Have a go on your own. A picture is 15 pixels wide and 12 pixels tall, with 2 bytes stored for every pixel. How many bytes does it take?
Ready to practice?
Eight questions on what you have just read. Nothing is timed, and you can play as many times as you like.