Skip to main content
Unit ConvertersFree · no sign-up

Bytes to MB Converter

Convert bytes to MB — for file sizes read straight off a system.

Updated

megabytes

1.000000MB

1,000,000 B = 1.000000 MB

In short

How many bytes are in a MB?

1,000,000 bytes. Divide a byte count by a million to get megabytes, so 5,242,880 bytes is 5.24 MB. Divide by 1,048,576 instead and you get mebibytes, MiB, which is the unit most software is really showing when it prints MB.

A byte count is exact. Everything ambiguous about this shelf starts one prefix later.

bytes to megabytes — quick reference

bytes (B)megabytes (MB)
1,000 B0.001000 MB
10,000 B0.010000 MB
100,000 B0.100000 MB
500,000 B0.500000 MB
1,000,000 B1.000000 MB
5,000,000 B5.000000 MB
10,000,000 B10.000000 MB
50,000,000 B50.000000 MB
Computed from the exact factor — rounded only for display.

The formula, worked line by line

One division by a million, or one by 1,048,576 if you want the binary answer. Both are given below, because the useful thing about starting from bytes is that you can produce either and say which is which.

Bytes are the only figure on this subject that two systems cannot disagree about. Everything above them is a labelling convention.
Why an exact count is worth keeping

That is the practical argument for recording byte counts in anything you build. A size stored as a rounded megabyte figure has thrown away both precision and provenance, and neither can be recovered later from the number itself.

megabytes = bytes / 1,000,000
mebibytes = bytes / 1,048,576
1 MB = 1,000,000 bytes
1 MiB = 2^20 = 1,048,576 bytes
1,474,560 bytes = 1.47456 MB = 1.40625 MiB
bytes against megabytesA twin scale: bytes along the top against megabytes along the bottom, with 1000000 B marked.BMB0012,500,00012.525,000,0002537,500,00037.550,000,00050BMB
Byte counts against megabytes, with the mebibyte line drawn beside the decimal one.
An upload against a stated 5 MB limit
File, exact count
5,150,000 bytes
Divided by 1,000,000
5.15 MB — over
Divided by 1,048,576
4.91 MiB — under
If the cap is 5,242,880 bytes
accepted
Verdict
depends entirely on the cap

Same file, same number, two opposite outcomes. This is the narrow band where the two scales fall on opposite sides of a limit, and it is exactly where a file lands after somebody has spent time compressing it to sit just under the stated figure.

Why the byte is eight bits

The eight-bit byte is a convention that won rather than a law of nature, and the standards reflect that. ISO/IEC 2382 defines the octet as exactly eight bits and treats it as equivalent to an eight-bit byte, which is the unambiguous term. Machines with other byte widths existed; the DEC PDP-10 allowed bytes of any width up to its 36-bit word.

The two ladders, from the byte up

Decimal beside binary
kilobyte
1,000 bytes
kibibyte
1,024 bytes
megabyte
1,000,000 bytes
mebibyte
1,048,576 bytes
gigabyte
1,000,000,000 bytes
gibibyte
1,073,741,824 bytes

Both ladders start from the same byte and diverge by 2.4 percent per rung. Nothing about the byte itself is in dispute, which is why converting from it is the cleanest place to start any of these calculations.

One consequence worth stating: if you are designing a limit, express it in bytes. A cap of 5,000,000 bytes cannot be misread, whereas a cap of "5 MB" will be interpreted differently by the person uploading and the server receiving, and the difference will land on somebody at the worst moment.

How to use the bytes to MB converter

A megabyte is a million bytes, so the conversion is six decimal places to the left. What makes this page worth reading is the direction it runs in. You have started from an exact byte count, which is the one figure on this whole subject that nobody can dispute, and that puts you in a position to settle the ambiguity rather than inherit it.

Byte counts come from machines that had no reason to round: a web server log, a storage API, the properties panel of a file. Because the count is exact, you can check it against both scales and see which one produced it. That is not possible once a figure has been rounded to "4.7 MB" and the divisor has been lost.

1,000,000

Bytes in a megabyte

decimal, SI

1,048,576

Bytes in a mebibyte

2^20, written MiB

48,576

The difference

about 4.9 percent

The test is quick. Divide the count by 1,048,576. If the answer is a clean number — a whole one, or a half, or a quarter — the figure came from a binary system. If dividing by a million gives the clean answer instead, it came from a decimal one. Very few counts look tidy on both scales, so the answer is usually unambiguous.

Byte counts also protect you from a subtler problem: rounding that has already happened. A figure reported as 4.7 MB could be anything from 4,650,000 to 4,749,999 bytes, a spread of a hundred thousand. When you are comparing against a hard limit, that spread is often wider than the margin you were relying on.

Counts worth recognising on sight
1,024
2^10, one KiB
1,048,576
2^20, one MiB
1,474,560
the 1.44 MB diskette
5,242,880
5 MiB, a very common cap
1,073,741,824
2^30, one GiB

The diskette is the odd one out and the most instructive. It is 1,440 units of 1,024 bytes, which is neither 1.44 million bytes nor 1.44 mebibytes. The label mixed the two scales together and the industry kept it for twenty years.

Take the same count up to gigabytes

For counts in the billions the divisor becomes a billion, and the gap between the two scales widens to about seven percent. That page runs it and shows both readings.

Open bytes to GB

Byte counts converted to megabytes on the decimal scale, with the mebibyte figure alongside so you can see which divisor produced a given number.

BytesMegabytes (decimal)Same count in MiB
1,0000.001 MB0.000954 MiB
100,0000.1 MB0.095367 MiB
1,000,0001 MB0.953674 MiB
1,048,5761.048576 MB1 MiB
1,474,5601.47456 MB1.40625 MiB
5,000,0005 MB4.768372 MiB
5,242,8805.24288 MB5 MiB
10,000,00010 MB9.536743 MiB
10,485,76010.48576 MB10 MiB
50,000,00050 MB47.683716 MiB
100,000,000100 MB95.367432 MiB
Middle column divides by 1,000,000 per SI. Right column divides by 1,048,576, which is 2^20 and gives mebibytes under IEC 80000-13.

The 1.44 MB diskette, which was neither

The best illustration of how tangled the labelling became is a format most people have handled. The high-density 3.5-inch diskette was sold as 1.44 MB. Its actual capacity is 2,880 sectors of 512 bytes, which is 1,474,560 bytes. That figure is 1.475 million bytes and it is 1.406 mebibytes. It is not 1.44 of either.

Where 1.44 came from
Sectors
2,880
Bytes per sector
512
Total bytes
1,474,560
Divided by 1,024
1,440 KiB
Then divided by 1,000
1.44
The label
1.44 "MB"

The capacity was divided by 1,024 once to reach kilobytes and then by 1,000 again to reach megabytes. Two different divisors in one calculation produced a unit that exists in no standard, and it went on the box of every diskette sold.

It is a useful thing to remember when a figure seems not to reconcile on either scale. Hybrid units are rare but they are not unheard of, and the only way to detect one is to work back to the byte count and see which divisors were applied in what order.

Reading a byte count in the wild

Web server logs record response size in bytes, which is why bandwidth reports built from them are exact rather than estimated. Storage APIs return byte counts for the same reason. So do file properties dialogs, if you look past the friendly rounded figure at the top to the exact number underneath.

Do

  • Keep the byte count whenever a comparison depends on it
  • Test a count against 1,048,576 to see which scale produced it
  • Write MiB when your divisor was 1,048,576
  • Read the exact figure rather than the rounded one in file properties

Don't

  • Compare a rounded MB figure against a byte-denominated limit
  • Assume a count ending in zeros is decimal — check the whole number
  • Convert twice with different divisors, which is how hybrids happen
  • Treat size on disk as the same figure as file size

That last point catches people. A file listing usually shows two numbers: the size of the content and the space it occupies once the filesystem has allocated whole clusters to it. A small file can occupy several times its own size. Upload limits measure content, so the smaller of the two is the one to convert.

Every bytes value, worked out

67 common bytes figures each get their own page, with the answer at full precision, the arithmetic, what rounding costs, and the nearest real-world reference point on the scale.

Questions people ask

Sources

Where the constants and formulas on this page come from. Each line names the figure it backs.

  1. One mebibyte is 2^20 bytes, 1,048,576, and is written MiB to distinguish it from the decimal megabyte of one million bytes.

    IEC 80000-13:2025 Quantities and units — Part 13: Information science and technologyInternational Electrotechnical Commission

  2. The octet is defined as an ordered sequence of eight bits considered as a unit, equivalent to an eight-bit byte.

    ISO/IEC 2382:2015 Information technology — VocabularyInternational Organization for Standardization

  3. The PDP-10 provided byte instructions operating on fields of any width within its 36-bit word.

    PDP-10 System Reference Manual, DEC-10-HGAA-DDigital Equipment Corporation