Mebibytes vs Megabytes

By | 2020-02-13

Discussing mebibytes vs megabytes can easily segue into other topics, but I’ll keep this short and to the point.

The short answer is a megabyte is 1,000,000 bytes while a mebibyte is 1,048,576 bytes. Mega is the SI prefix for 1,000,000. Mebi is the IEC prefix for 220.

The IEC versions of the other SI prefixes are all multiples of 10 of powers of 2. E.g. kibi is 1,024 or 210, mebi is 1,048,576 or 220, gibi is 1,073,741,824 or 230 and so forth.

On modern Linux computer systems, commands tend to output sizes using the IEC prefixes. It isn’t uncommon for them to also support the SI prefixes as well. If you prefer the SI prefixes, commands that support it typically use the --si option to specify SI instead of IEC prefixes.

On computer system a common convention is the prefix is capitalized if it is the IEC version, and lower case if it is the SI prefix. Another common convention is to explicitly place an i between the prefix and the b or B (bits and bytes, respectively). E.g. Mib or MiB for mebibits and mebibytes, respectively.

Unfortunately, there are cases where KB can mean 1000 and others 1024. Computer storage devices have commonly used the SI prefix on the packaging, while operating systems use the powers of 2 versions. There have even been lawsuits in the United States over it.

If you want to know more about the reasons and history of why the IEC prefixes came about, the Wikipedia article below covers the topic very well. The short answer is powers of 2 are easy for electronics and powers of 10 are easy for humans.

References