MiB vs MB: Mebibytes, Megabytes and Binary Prefixes
MiB vs MB: a mebibyte is 1,048,576 bytes and a megabyte is 1,000,000 bytes. Learn the IEC binary prefixes (KiB, MiB, GiB) and which systems use which unit.
Updated
A mebibyte (MiB) is 1,048,576 bytes, and a megabyte (MB) is 1,000,000 bytes. MiB is a binary unit based on powers of 1,024, while MB is a decimal unit based on powers of 1,000, so 1 MiB is about 4.9 percent larger than 1 MB. To convert, 1 MiB equals 1.048576 MB and 1 MB equals about 0.9537 MiB.
Two units, one old name
For most of computing history, "megabyte" had two meanings. Memory engineers used it for 1,024 × 1,024 bytes, because memory sizes are powers of two. Disk makers and network engineers used it for a million bytes, because mega means a million in the metric system. Neither side was wrong by its own convention, but the same word described two different quantities.
The binary prefixes were created to give each quantity its own name. Under the standard, MB always means the decimal unit and MiB always means the binary one.
The IEC binary prefixes
The International Electrotechnical Commission introduced the binary prefixes in an amendment to its IEC 60027-2 standard, approved in December 1998 and published in January 1999. They are now part of the international quantities standard ISO/IEC 80000-13, and standards bodies such as NIST in the US recommend them.
Each name takes the first two letters of the metric prefix and adds "bi" for binary: kilo becomes kibi, mega becomes mebi, giga becomes gibi. The symbols add a lowercase i.
| Binary unit | Symbol | Bytes | Power of two | Larger than the decimal unit by |
|---|---|---|---|---|
| Kibibyte | KiB | 1,024 | 2^10 | 2.4 percent (vs kB) |
| Mebibyte | MiB | 1,048,576 | 2^20 | 4.9 percent (vs MB) |
| Gibibyte | GiB | 1,073,741,824 | 2^30 | 7.4 percent (vs GB) |
| Tebibyte | TiB | 1,099,511,627,776 | 2^40 | 10 percent (vs TB) |
| Pebibyte | PiB | 1,125,899,906,842,624 | 2^50 | 12.6 percent (vs PB) |
Exbibyte (EiB), zebibyte (ZiB) and yobibyte (YiB) continue the series. Note that the gap widens at each step, because the 2.4 percent difference compounds.
Converting between MiB and MB
- MiB to MB: multiply by 1.048576.
- MB to MiB: divide by 1.048576.
| MiB | MB | MB | MiB |
|---|---|---|---|
| 1 | 1.049 | 1 | 0.954 |
| 100 | 104.9 | 100 | 95.37 |
| 256 | 268.4 | 250 | 238.4 |
| 512 | 536.9 | 500 | 476.8 |
| 1,024 | 1,073.7 | 1,000 | 953.7 |
For gigabytes the factor is 1.073741824: 1 GiB is about 1.074 GB, and 1 GB is about 0.931 GiB. That last number is the one behind the well-known shrinking hard drive, worked through in How Many GB in a TB.
Which operating system uses which
| System | How it counts | How it labels |
|---|---|---|
| Windows | Binary (1,024) | KB, MB, GB |
| macOS, version 10.6 and later | Decimal (1,000) | KB, MB, GB |
Linux command line (ls -lh, du -h, df -h) | Binary (1,024) by default | K, M, G |
| Linux desktop file managers | Varies; GNOME Files uses decimal | KB, MB, GB |
| Kubernetes resource limits | Both: Mi is binary, M is decimal | As written |
Windows is the main source of confusion, because it shows binary values under decimal names. A file of exactly 1,000,000 bytes is 1 MB by definition, yet Windows lists it as roughly 0.95 MB.
On Linux, the GNU tools make the choice explicit. ls -lh and df -h use powers of 1,024, and adding --si (or df -H) switches them to powers of 1,000.
Where each unit shows up in practice
Binary units, whether labeled correctly or not:
- RAM. A "16 GB" memory kit is 16 GiB. Memory sizes are always powers of two.
- Cloud infrastructure. Many cloud providers quote instance memory and disk volumes in GiB, and container tools use
MiandGisuffixes. - Disk partitioning and virtual machine settings, which commonly work in MiB.
Decimal units:
- Hard drives, SSDs, memory cards and USB sticks. The capacity on the box is always decimal.
- Network speeds. A megabit per second is 1,000,000 bits per second, with no binary variant in normal use. See Bits vs Bytes.
- macOS and iOS storage screens.
One historical oddity mixes both. The "1.44 MB" floppy disk holds 1,474,560 bytes, which is 1,440 × 1,024. Its megabyte is a thousand binary kilobytes, matching neither definition.
When the difference actually matters
For a single photo or document, 4.9 percent is noise. It matters when a limit is exact:
- Memory limits. A container limited to
512Mgets 512,000,000 bytes, while512Migets 536,870,912. A process that needs the full binary amount will be killed under the smaller one. - Partition and image sizes. A disk image sized in MiB may not fit a device whose capacity was read in MB.
- Billing and quotas. A storage quota in GiB gives about 7.4 percent more room than the same number in GB.
- Capacity planning. At the terabyte level the two systems differ by 10 percent, enough to make a backup not fit.
When you write a size down for someone else, use MiB or GiB if you mean powers of 1,024. When you read a size, check the source: "MB" from Windows or a RAM label is binary, and "MB" from a drive maker or macOS is decimal.
For the everyday version of the same question, see How Many MB in a GB and KB vs MB.
Using the converter
The Data Size Converter has a toggle for the two systems. Binary mode works in B, KiB, MiB, GiB, TiB and PiB with a factor of 1,024. SI Decimal mode works in B, KB, MB, GB, TB and PB with a factor of 1,000. Enter a value and unit, and every other unit in that system is shown in a table.
Each mode converts within its own system, so going from MiB to MB uses bytes as the bridge:
- In Binary mode, enter 512 and choose MiB. The B row shows 536,870,912.
- Switch to SI Decimal, choose B as the unit and enter 536870912. The MB row shows 536.870912.
Try it
Open the Data Size Converter, enter 1 with the unit set to GiB in Binary mode, and note the byte count. Then enter that byte count in SI Decimal mode to see the 1.074 GB figure for yourself. More converters are in the numbers category.