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
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

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:
| Bytes | MB (1000) | MiB (1024) |
|---|---|---|
| 1024 | 0.001024 MB | 0.0009766 MiB (1 KiB) |
| 65,536 | 0.0655 MB | 0.0625 MiB (64 KiB) |
| 1,000,000 | 1 MB | 0.9537 MiB |
| 1,048,576 | 1.0486 MB | 1 MiB |
| 10,485,760 | 10.4858 MB | 10 MiB |
| 52,428,800 | 52.4288 MB | 50 MiB |
| 100,000,000 | 100 MB | 95.3674 MiB |
| 134,217,728 | 134.2177 MB | 128 MiB |
| 262,144,000 | 262.144 MB | 250 MiB |
| 536,870,912 | 536.8709 MB | 512 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 | MB (1000) | MiB (1024) |
|---|---|---|
| 1,000 | 0.001 MB | 0.00095 MiB |
| 100,000 | 0.1 MB | 0.0954 MiB |
| 500,000 | 0.5 MB | 0.4768 MiB |
| 5,000,000 | 5 MB | 4.7684 MiB |
| 5,242,880 | 5.2429 MB | 5 MiB |
| 10,000,000 | 10 MB | 9.5367 MiB |
| 26,214,400 | 26.2144 MB | 25 MiB |
| 104,857,600 | 104.8576 MB | 100 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:
| Language | Decimal MB | Binary MiB |
|---|---|---|
| JavaScript | (bytes / 1e6).toFixed(2) | (bytes / 1048576).toFixed(2) |
| Python | round(n / 1_000_000, 2) | round(n / 1024**2, 2) |
| Excel | =A2/1000000 | =A2/1048576 |
| Bash | echo "scale=2; $n/1000000" | bc | numfmt --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.

