Bytes to MB converter

Convert a byte count to megabytes. Divide by 1,000,000 for MB, or by 1,048,576 for MiB, the binary megabyte that Windows and many programs show.

Show the working
Same size in every unit
Conversion table
You can type the unit too, for example 750 MB.
Checked bySharmina Rahman
Reviewed byJack Goldsmith
Last updated · How we test

Runs in your browser. Nothing you type is uploaded.

How many bytes in a megabyte?

A megabyte is 1,000,000 bytes in decimal units. A binary megabyte, written MiB, is 1024 × 1024 = 1,048,576 bytes. So to convert bytes to MB:

MB = bytes ÷ 1,000,000   or   MiB = bytes ÷ 1,048,576

Bytes to MB worked example: 5,242,880 bytes divided by 1,000,000 is 5.2429 MB in decimal units, and 5,242,880 bytes divided by 1,048,576 is 5 MiB in binary units.

Common byte counts in MB

Some byte counts come up again and again because they are exact powers of two. These are the ones people look up most:

BytesMB (1000)MiB (1024)
10240.001024 MB0.0009766 MiB (1 KiB)
65,5360.0655 MB0.0625 MiB (64 KiB)
1,000,0001 MB0.9537 MiB
1,048,5761.0486 MB1 MiB
10,485,76010.4858 MB10 MiB
52,428,80052.4288 MB50 MiB
100,000,000100 MB95.3674 MiB
134,217,728134.2177 MB128 MiB
262,144,000262.144 MB250 MiB
536,870,912536.8709 MB512 MiB

Round MiB values such as 50 or 128 turn into long, uneven decimal numbers, and the other way round. Settings files and server configs often use these binary sizes, for example a 128 MiB memory limit written as 134217728.

Bytes to MB conversion table

Bytes to MB conversion chart: 1,000 bytes is 0.001 MB or 0.000954 MiB; 10,000 bytes is 0.01 MB or 0.009537 MiB; 100,000 bytes is 0.1 MB or 0.095367 MiB; 500,000 bytes is 0.5 MB or 0.476837 MiB; 1,000,000 bytes is 1 MB or 0.953674 MiB, and more.
BytesMB (1000)MiB (1024)
1,0000.001 MB0.00095 MiB
100,0000.1 MB0.0954 MiB
500,0000.5 MB0.4768 MiB
5,000,0005 MB4.7684 MiB
5,242,8805.2429 MB5 MiB
10,000,00010 MB9.5367 MiB
26,214,40026.2144 MB25 MiB
104,857,600104.8576 MB100 MiB

MB to bytes

To go back, multiply. 1 MB is 1,000,000 bytes, 5 MB is 5,000,000 bytes, and 25 MB is 25,000,000 bytes. In binary units 1 MiB is 1,048,576 bytes and 5 MiB is 5,242,880 bytes. Swap the units in the converter to see both.

Bytes to MB in code

File APIs return sizes in bytes. In JavaScript, file.size on an uploaded File object is in bytes, as MDN's Blob.size reference notes, and in Python os.path.getsize() returns bytes too, per Python's os.path documentation. These lines turn them into megabytes:

LanguageDecimal MBBinary MiB
JavaScript(bytes / 1e6).toFixed(2)(bytes / 1048576).toFixed(2)
Pythonround(n / 1_000_000, 2)round(n / 1024**2, 2)
Excel=A2/1000000=A2/1048576
Bashecho "scale=2; $n/1000000" | bcnumfmt --to=iec $n

Pick one standard and label it clearly. If you divide by 1024 steps, write KiB, MiB or GiB so users do not confuse your number with the decimal one. A common display rule: below 1000 bytes show bytes, below a million show KB, below a billion show MB.

MB or MiB?

The IEC created MiB in 1998 so that MB could keep its metric meaning of one million bytes. Linux tools such as ls -lh print sizes in powers of 1024, and Windows does the same while labeling them MB. Drive makers and macOS use real millions. The byte converter shows a byte count in every unit at once, and MB to GB takes the result a step further.

Frequently asked questions

How many bytes are in 1 MB?

1,000,000 bytes in decimal units and 1,048,576 bytes in binary units (1 MiB).

What is 1048576 bytes in MB?

Exactly 1 MiB, or 1.05 MB in decimal units.

Is 1 MB 1024 bytes?

No. 1024 bytes is one kilobyte in the binary system. A binary megabyte is 1024 × 1024 = 1,048,576 bytes.

How many MB is 1,000,000 bytes?

1 MB in decimal units, or 0.95 MiB in binary units.

Why is my file "too large" when it shows 24.9 MB?

The site may count in decimal MB while your computer shows binary MB. 24.9 MiB is 26.1 decimal MB, which is over a 25 MB limit.

Scroll to Top