GameParticles
Numbers & units

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 unitSymbolBytesPower of twoLarger than the decimal unit by
KibibyteKiB1,0242^102.4 percent (vs kB)
MebibyteMiB1,048,5762^204.9 percent (vs MB)
GibibyteGiB1,073,741,8242^307.4 percent (vs GB)
TebibyteTiB1,099,511,627,7762^4010 percent (vs TB)
PebibytePiB1,125,899,906,842,6242^5012.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.
MiBMBMBMiB
11.04910.954
100104.910095.37
256268.4250238.4
512536.9500476.8
1,0241,073.71,000953.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

SystemHow it countsHow it labels
WindowsBinary (1,024)KB, MB, GB
macOS, version 10.6 and laterDecimal (1,000)KB, MB, GB
Linux command line (ls -lh, du -h, df -h)Binary (1,024) by defaultK, M, G
Linux desktop file managersVaries; GNOME Files uses decimalKB, MB, GB
Kubernetes resource limitsBoth: Mi is binary, M is decimalAs 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 Mi and Gi suffixes.
  • 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 512M gets 512,000,000 bytes, while 512Mi gets 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:

  1. In Binary mode, enter 512 and choose MiB. The B row shows 536,870,912.
  2. 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.

Tools in this guide

Frequently asked questions

What is the difference between MiB and MB?

A mebibyte (MiB) is 1,048,576 bytes, which is 1,024 times 1,024. A megabyte (MB) is 1,000,000 bytes. The MiB is about 4.9 percent larger. MiB is the binary unit defined by the IEC, and MB is the decimal SI unit.

How do you convert MiB to MB?

Multiply the MiB value by 1.048576 to get MB. To go from MB to MiB, divide by 1.048576, or multiply by about 0.9537. For example, 512 MiB is about 536.9 MB, and 500 MB is about 476.8 MiB.

What are KiB, MiB and GiB?

They are binary prefixes standardized by the IEC. A kibibyte (KiB) is 1,024 bytes, a mebibyte (MiB) is 1,024 KiB, and a gibibyte (GiB) is 1,024 MiB. They exist so that KB, MB and GB can keep their metric meanings of exactly 1,000 per step.

Does Windows use MB or MiB?

Windows calculates sizes in binary units, dividing by 1,024 at each step, so its numbers are really KiB, MiB and GiB. It labels them KB, MB and GB. That is why a file of 1,000,000 bytes shows as about 0.95 MB in Windows.

More numbers & units guides

JSON Formatter
Developer · Format, validate and minify JSON with syntax highlighting.
↵
Base64 Encode / Decode
Developer · Encode text to Base64 or decode Base64 back to plain text.
↵
URL Encoder / Decoder
Developer · Encode or decode URL components and query strings.
↵
Hash Generator
Developer · Generate MD5, SHA-1, SHA-256 and SHA-512 hashes.
↵
UUID Generator
Developer · Generate UUIDs v4 (random) in bulk with one click.
↵
Regex Tester
Developer · Test regular expressions against text with live match highlighting.
↵
Word Counter
Text · Count words, characters, sentences, paragraphs and reading time.
↵
Case Converter
Text · Convert text between UPPER, lower, Title, camelCase, snake_case and more.
↵
List Sorter
Text · Sort, reverse, deduplicate and shuffle lists of text.
↵
Markdown Preview
Text · Write Markdown and see a live rendered preview side by side.
↵
Percentage Calculator
Numbers · Calculate percentages, increases, decreases and what % one number is of another.
↵
Color Converter
Colors · Convert colors between HEX, RGB, HSL and HSV instantly.
↵
Snake
Arcade · Eat food, grow longer, don't hit the walls. A timeless classic.
↵
2048
Puzzle · Slide tiles and combine them to reach the legendary 2048 tile.
↵
Word Grid
Puzzle · Guess the hidden five letter word in six tries using color clues.
↵
Sudoku
Puzzle · Fill the 9x9 grid with logic. Four difficulties from easy to expert.
↵
Minesweeper
Strategy · Use number clues to clear the minefield. Classic logic, three levels.
↵
Breakout
Arcade · Smash every brick with paddle and ball. Power-ups, combos, endless levels.
↵
Typing Practice
Casual · Build your WPM and accuracy with timed drills from 30 seconds to 5 minutes. Find your weak keys.
↵
TypeRunner
Arcade · Multiplayer typing race. Race friends by link, beat computer runners, or chase your own ghost.
↵
Typing Blocks
Arcade · Type each word before its wooden block lands. Miss, and the pile climbs toward the line.
↵
Bubble Shooter
Arcade · Aim, bank shots off the walls, and pop groups of three or more bubbles.
↵
Road Rush
Arcade · Race seven rivals through traffic and punch your way to the front.
↵