Lesson 5 of 5 · Open
Kilobytes, megabytes, gigabytes
How large amounts of data are counted, and how to convert from one unit to another.
Your phone has 2 GB free. You want to store 800 vacation photos, each about 3 MB. Will they fit? At first the numbers do not help: 2 is much less than 800 · 3, but GB and MB do not count the same thing. The amounts can only be compared once both are in the same unit.
Amounts of data are counted in bytes. Because a single photo already has millions of bytes, there are larger units, made the same way as for meters and grams. A prefix in front of the unit says what number it is multiplied by: kilo means thousand, mega million, giga billion, tera trillion. So a kilobyte (kB) is 1,000 bytes, just as a kilometer is 1,000 meters.
Each further step is again 1,000 times as large: a megabyte (MB) is 1,000 kB, a gigabyte (GB) is 1,000 MB, and a terabyte (TB) is 1,000 GB.
| Unit | Symbol | Equals |
|---|---|---|
| Byte | B | 8 bits |
| Kilobyte | kB | 1,000 bytes |
| Megabyte | MB | 1,000 kB |
| Gigabyte | GB | 1,000 MB |
| Terabyte | TB | 1,000 GB |
New terms
- prefix
- a syllable in front of a unit that multiplies it: kilo thousand, mega million, giga billion, tera trillion
- kilobyte
- kB, 1,000 bytes
- megabyte
- MB, 1,000 kilobytes, so a million bytes
- gigabyte
- GB, 1,000 megabytes, so a billion bytes
- terabyte
- TB, 1,000 gigabytes
From step to step
If you go one step down, say from MB to kB, the number gets 1,000 times as large: every MB splits into 1,000 kB. If you go one step up, say from bytes to kB, the number gets 1,000 times smaller, because every 1,000 bytes become one kB. Across two steps, you do it twice.
Example
A page of text
A page has about 2,000 characters, spaces included. How large is it in ASCII?
- In ASCII, every character takes 1 byte.
- So 2,000 characters take 2,000 bytes.
- From bytes to kB is one step up: 2,000 : 1,000 = 2
- The page is about 2 kB.
Quick check
You convert GB to MB. Do you multiply by 1,000 or divide?
Example
Will the vacation photos fit?
Back to the question from the start: 800 photos of about 3 MB each, with 2 GB free.
- All the photos together: 800 · 3 MB = 2,400 MB
- The free space one step down: 2 · 1,000 = 2,000 MB
- Now both amounts are in MB: 2,400 is more than 2,000.
- Not all the photos fit, about 400 MB is missing.
Typical mistake
Going the wrong way and converting 3 MB to kB as 3 : 1,000. Then a photo would be 0.003 kB, which is 3 bytes, as much as three letters. That cannot be right: a kB is smaller than an MB, so it takes more of them. Toward the smaller unit, the number gets larger: 3 MB is 3,000 kB.
How big is what?
A few sizes to get a feel for it. They are round values: how large a photo or a movie really is depends on the device and the quality.
| What | About |
|---|---|
| Short message | 100 bytes |
| Page of text | 2 kB |
| Phone photo | 3 MB |
| Feature film | 2 GB |
| Phone storage | for example 128 GB |
| External drive | 1 TB |
1,000 or 1,024?
Some programs do not count with 1,000 but with 1,024, because that number is made of nothing but twos and fits bits well. Strictly speaking, these steps have other names: kibibyte (KiB) for 1,024 bytes, then mebibyte (MiB) and gibibyte (GiB). Many programs still write just MB and GB.
That is why a computer sometimes shows a 1 TB drive as only about 931 GB: it counts with 1,024 and actually means GiB. No storage is missing, the steps are just larger. Here we always count with 1,000, as the packaging does.
Remember
Tasks
Task 1 · Input
A video from the family chat is 45 MB. How many kB is that?
Task 2 · Input
A folder of invoices takes 250,000 kB. How many MB is that?
Task 3 · Order
Order from the smallest to the largest amount of data.
- 15 GB
- 21,500 MB
- 34 MB
- 42 TB
- 5700 kB
Go deeper
Task 4 · Input · optional
An external drive holds 0.5 TB. How many MB is that?
Task 5 · Choice · optional
This is how a 128 GB phone is filled. Will an update of 12,000 MB still fit?
GB
Task 6 · Pairs · optional