Short version to remember, maybe:
| A byte is one character of plain text. A megabyte (MB) is a little more than a million bytes. A gigabyte (GB) is a little more than a thousand megabytes. A terabyte (TB) is a little more than a thousand gigabytes, and so forth. |
Long version:
| unit | definition | comments | IEC definition (see below) | |
|---|---|---|---|---|
| bit | --- | One binary digit | Smallest piece of information a computer can store | (same) |
| byte | --- | Eight bits | One character of plain text: 01000001 = "A" | (same) |
| --- | K | 1,024 bytes | Now used mostly for file sizes in folder windows. (1,024 = 210 > 103) | 1,000 bytes (103) |
| megabyte | MB | 1,024 K = 1,048,576 bytes > one million bytes |
Used for capacities of RAM memory and removable formats such as diskettes and flash media. (1,048,576 = 220 > 106) | 1,000,000 bytes (106) |
| gigabyte | GB | 1,024 MB = 1,073,741,824 bytes > one billion bytes* |
Used for capacities of hard disks and larger removable formats. (1,073,741,824 = 230 > 109) | 1,000,000,000 bytes (109) |
| terabyte | TB | 1,024 GB = 1.0995 × 1012 bytes > one trillion bytes* |
Only used for things like the total size of the Web, which in 1998 was estimated at ten terabytes. (1.0995 × 1012 = 240 > 1012) | 1012 bytes |
| petabyte | PB | 1,024 TB = 1.1259 × 1015 bytes > one quadrillion bytes* |
1.1259 × 1015 = 250 > 1015 | 1015 bytes |
| exabyte | EB | 1,024 PB = 1.1529 × 1018 bytes > one quintillion bytes* |
1.1529 × 1018 = 260 > 1018 | 1018 bytes |
Why powers of two? What's wrong with those nice round numbers the IEC likes? Computers do everything in base two, because at the hardware level their operations depend on literally millions of tiny transistor circuits that only have two states, on and off. We humans do arithmetic in base ten because we have ten fingers.
To a computer the number 1,024—two to the tenth power—is a round number, and 1,000 is not:
| Base 10, decimal | Base 2, binary | Base 16, hexadecimal |
|---|---|---|
| 1,024 | 10000000000 | 400 |
| 1,000 | 1111101000 | 3E8 |
There are two conflicting sets of definitions in use for computer storage units such as megabyte, gigabyte, and so forth.
The International Electrotechnical Commission, www.iec.ch, asserts a set of decimal-based "definitions" for these commonly-used terms. The original binary-based definitions of these terms are better established in practical usage, and more meaningful relative to real memory architecture on the chip. The original binary units are seen in documentation for conventional RAM memory and CDs, and in software including file sizes. You'll see the IEC definitions used in manufacturer documentation of storage capacities of hard disks and DVDs, sometimes flash media including USB, and in networking contexts. When documentation uses the IEC units, typically they just baldly assert that one megabyte equals one million bytes, without any explanation or mention of the IEC.
The IEC also asserts the following bizarre terms and abbreviations for the original binary-based storage units, instead of those commonly used:
kebibyte, KiB = 210 bytes
mebibyte, MiB = 220 bytes
gibibyte, GiB = 230 bytes
tebibyte, TiB = 240 bytes
pebibyte, PiB = 250 bytes
exbibyte, EiB = 260 bytes
As near as I can determine, nobody really likes the IEC system but the IEC and storage media manufacturers. Adopting the IEC definitions, without explanation, lets them claim a capacity in "gigabytes" which will appear to a casual reader to be 7.4% larger than the actual capacity of the device. Perhaps this is the digital-world equivalent of false bottoms in supermarket berry baskets. I've never seen anyone use the IEC's "mebibyte/gibibyte" terms for anything other than explaining this issue.
I will admit, if pressed, that the IEC definitions are superficially more consistent with prior and ongoing usage of prefixes like "mega" and "giga" in ISV and (non-computer) science. They also fly in the face of the usages established and understood by the people who actually created the computer revolution. Why do I have the feeling this was some French person's idea? See the Wikipedia definition of megabyte for further details and discussion.