MB (MegaByte) was 1,048,576 bytes
Historically, Disk/Memory were manufactured based on powers of 2. Disk sectors were often 2^9 = 512 bytes, and 1K was 2^10 = 1024 bytes, and a megabyte was:
1K * 1024 = 1024MB = 1024 x 1024 = 1,048,576 bytes
(where 1K = 1024 bytes).
Disk drives were marketed using Megabytes, so to get to 1 Gigabyte (1 GB), you would get take
1MB * 1024 = 1024MB (same as 2^30 = 1,073,741,824)
NOTE: Later this will be called 1 GiB.
Why 1024? Because the relationship was with the power of 2s. (Quora reference):
1byte = 8bits (2^3)
1KB = 1024 bytes (2^10)
1MB = 1024KB (2^20)
1GB = 1024MB (2^30)
So
2^10 MiB === 2^10 x 1,048,576 bytes === 1,073,741,824 bytes (or 1 GiB)
In summary:
1 MB = 1,000,000 bytes
1 MiB = 1,048,576 bytes (2^20)
1 GB = 1,000,000,000 bytes
1 GiB = 2^30 = 1,073,741,824 bytes (same as 2^10 MiB)
Megabyte is now 1,000,000 bytes
So why do people call a MB (Megabyte) 1,000,000 bytes
?
The term MB
changed it's definition when some operating systems reported data sizes calling Mega bytes as 1,000,000 bytes which is different than what the disk manufacturers were calling Megabytes. For a variety of reasons, the industry standardized on Megabyte (MB) being 10^6
or 1,000,000 bytes
, not 2^20 bytes
.
Later, some group wanted a term to refer to a disk sizes using disk megabytes (my made up term) and they had to come up with a new term. The new term was MiB (mebibyte) was created to represent a megabyte being 1024 * 1024 bytes.
Mebibyte = 2^20 = 1024 x 1024 = 1,048,576 bytes
So now you ask: Gigabyte or Gibibyte (1000 or 1024)?
The selected answer provides a good answer: The sad fact is that it depends on who you ask
This answer, hopefully, helps explain why the answer depends.
If you ask someone who is 20, the answer is clear. If you ask someone who is a disk technology expert, the answer may be different because of the history I explained above.
References
Data Sizes Kilobytes Megabytes Gigabytes Terabytes
How many in a Byte? 0.001 KB 0.000001 MB 0.000000001 GB 0.000000000001 TB
How many in an KB? 1 KB 0.001 MB 0.000001 GB 0.000000001 TB
How many in an MB? 1000 KB 1 MB 0.001 GB 0.000001 TB
How many in a GB? 1000000 KB 1000 MB 1 GB 0.001 TB
How many in a TB? 1000000000 KB 1000000 MB 1000 GB 1 TB
This table clearly has megabytes in terms of 10 to the power of something. So 10^6 = 1,000,000.