Sizes that code and dialogs disagree about
A web form says the upload limit is 5 MiB, the server setting is written in bytes, and the file manager shows the size in a third style. Developers, administrators and anyone configuring a limit need the byte count that the software will compare. This page turns mebibytes into bytes using the binary definition, so the number you put in a configuration file is the number the program checks. Getting it wrong by using 1,000,000 instead of 1,048,576 shifts the limit by about 4.9 percent, enough to reject a file that the label promised to accept, or to let one through that should have been blocked.
Two to the twentieth power
The mebibyte was introduced by the International Electrotechnical Commission in the late 1990s to remove the ambiguity of the word megabyte, and it is now part of IEC 80000-13. One mebibyte is 2²⁰ bytes, or 1,048,576 bytes, which is 1,024 kibibytes of 1,024 bytes each. The formula is B = MiB × 1,048,576. The factor is an integer, so whole-number inputs give whole-number byte counts, and no rounding is needed inside the conversion. Fractions of a mebibyte can produce fractional bytes, which a real file cannot have, so round such results to the nearest whole byte when you apply them.
Ten mebibytes in bytes
The opening example enters 10 MiB and returns 10,485,760 B. A quick check is to start from 1,048,576 and multiply by 10, which moves the digits one place and appends a zero. A ten mebibyte limit is therefore 485,760 bytes more than ten million. That difference is small in relative terms, but a file of 10,300,000 bytes fits under the limit as binary and not as decimal. The page also supports other source units, so you can enter a value in kibibytes or megabytes to see how the same limit looks in the unit your software uses.
Upload limits and form validation
A developer who writes a validator for a profile photo might set the maximum at 5 MiB. The page returns 5,242,880 B, and that is the integer to put in code. A 2 MiB limit is 2,097,152 B. When a product manager writes 5 MB and means decimal, the limit is 5,000,000 B, which equals 4.76837 MiB. Both are reasonable limits, and the key is to choose one and write it in the interface text in the same form the code uses. A file picker that shows 4.9 MB for a file of 5,100,000 bytes can leave the user confused if the limit text says 5 MiB.
Buffers and memory allocation
Programs allocate memory in bytes, and engineers like sizes that are powers of two. A 16 MiB buffer is 16,777,216 bytes, and a 64 MiB buffer is 67,108,864 bytes. The first is 2²⁴ and the second 2²⁶, which map cleanly onto address bits and page boundaries. Writing the size in mebibytes in a comment and the byte count in code, with the conversion checked on this page, reduces the chance of an off-by-a-factor error. If a program reports an allocation failure for a 64 MiB request, you can compare the byte count in the log with the expected value before you look for a deeper cause.
What operating systems display
File sizes are shown in different styles. Windows File Explorer divides by powers of 1,024 and labels the result KB, MB and GB. Linux tools such as ls with the human-readable flag and du also use 1,024 and print K, M and G. Apple changed its systems to decimal units with Mac OS X 10.6, so a file that shows 5.2 MB there is about 4.96 MiB. When you compare a file size from two machines, convert both to bytes first. The byte count is the only figure that is the same everywhere, and the page gives you the exact number to compare. A 700 MiB disc image, for example, is 734,003,200 bytes, which a decimal-based tool would list as 734 MB, and a 4,096 MiB archive is 4,294,967,296 bytes, a figure that programmers recognize as 2 to the power 32.
A photo size with a fraction
A photo that a gallery lists as 3.2 MiB comes out at 3,355,443.2 bytes. Real files contain whole bytes, so the true size lies near 3,355,443, and the displayed 3.2 is a rounded value. If you need the exact figure, find it in the file properties, which list bytes. The conversion is useful when you want an approximate byte budget for a set of images, such as a gallery that must fit in a fixed quota before an upload begins. Thirty such photos take about 100,663,296 bytes, or 96 MiB, which fits in a 128 MiB cache with room to spare. Round up when planning storage, since a shortfall is more costly than a margin.
From bytes back to mebibytes
Reverse the selection when a log or an error message gives bytes. A request body of 5,000,000 bytes is 4.76837 MiB, and 524,288 bytes is exactly 0.5 MiB. The ratio 1 over 1,048,576 is about 9.5367e-7. Read the output against the limit you had in mind, in the same unit. If a server rejects 5,100,000 bytes against a 5 MiB limit, the conversion shows it is within the limit at 4.86 MiB, and the cause lies elsewhere, such as a separate proxy setting or a multipart overhead. This kind of check saves time when you are tracing why an upload fails. Some servers also count the whole request, including form fields and boundaries, so a file slightly under the limit can still be refused, and the extra bytes of overhead are usually a few hundred at most.
Choosing prefixes in documentation
Write MiB when you mean 1,048,576 bytes, and MB when you mean 1,000,000 bytes. A reader who sees MB cannot be sure which one you mean unless the context says so. The IEC symbols are Ki, Mi, Gi and Ti for binary multiples, and the SI symbols k, M, G and T for decimal ones. Mixed documents often use both, so check each figure against its source. If you copy a number from a tool, copy its unit as well. The page labels the source and target units fully in its menus so that you can see which definition each calculation uses.