Two kinds of kilo in one number

Storage vendors, network standards and most websites describe a megabyte as 1,000,000 bytes. Many programming tools, memory maps and microcontroller datasheets count in kibibytes, where one KiB is 1,024 bytes. The IEC introduced the kibi prefix in 1998 so that kB and KiB would not be confused, and NIST SP 811 recognizes it. This converter moves a size from the first world to the second. The default of 10 MB returns 9,765.625 KiB. Because 1,000,000 divided by 1,024 is 976.5625, every decimal megabyte contains 976.5625 kibibytes.

Why 1 MB is 976.5625 KiB

The page converts megabytes to bytes by multiplying by 1,000,000 and then divides by 1,024. The combined factor, 976.5625, is exact because 1,000,000 / 1,024 terminates after four decimal places. So 1 MB is 976.5625 KiB, 2 MB is 1,953.125 KiB and 3 MB is 2,929.6875 KiB. A value of 0.5 MB is 488.28125 KiB, and 0.256 MB is exactly 250 KiB. In the other direction, multiply KiB by 1.024 to get kilobytes and divide by 1,000 to reach megabytes. For example, 512 KiB is 524,288 bytes, which is 0.524288 MB.

Firmware and flash memory

Embedded developers plan firmware in kibibytes because flash memory is built in power-of-two sizes. A microcontroller with 512 KiB of flash holds 524,288 bytes, or about 0.524 MB. If your toolchain reports a firmware image of 1.5 MB in decimal terms, the image takes 1,464.84 KiB, which fits in a 2,048 KiB part with room to spare and does not fit in 1,024 KiB. Linker reports and map files usually use binary sizes, so the conversion avoids a mismatch between a vendor figure and the build output.

Memory limits on small devices

Application notes for small boards list RAM in kibibytes: 64, 128, 256 KiB and so on. A requirement written as 0.25 MB of working memory is 250,000 bytes, which is about 244.14 KiB, so it fits in a 256 KiB RAM only if the program and the operating system need no more than the remaining 11.86 KiB. That kind of margin shows up quickly on small devices. Do the conversion before you accept a requirement stated in decimal megabytes. A related case is a lookup table of 100,000 bytes, which is 0.1 MB and 97.66 KiB. In a 128 KiB flash region it leaves about 30 KiB for everything else, and the same table written as 0.1 MB in a requirements document hides how tight that is. Writing both figures in the design notes helps the next engineer who reads them.

Linux and command-line output

Commands such as du and ls with human-readable flags print K, M and G using powers of 1,024. A directory shown as 9.8M in that output is about 9.8 MiB, which is 10.28 MB. When you compare such output with a size given in a ticket or a vendor document, convert one side. A file listed as 9,765K in a terminal is 9,765 KiB and equals about 10 MB. Seeing that both numbers describe the same file prevents a debate over a gap that is only a unit difference. System administrators run into this when a log rotation policy says 5 MB and the rotated files measure 4,883K in a listing. That is 4,883 KiB, or about 5.0 MB, so the policy is working as written. Converting a few sample files with this page is a fast way to confirm that.

Network buffers and packet sizes

Socket buffers, MTU-related settings and message queue limits are often written in KiB. A buffer of 256 KiB holds 262,144 bytes, which is 0.262144 MB. A design document that asks for a 0.25 MB buffer will get 244.14 KiB at the same size, a number that is not a power of two and is therefore not a natural setting. Round the requirement to a nearby power of two, such as 256 KiB, and note that the buffer is then 4.9 percent larger than 0.25 MB in decimal terms. Memory-constrained applications, such as a data logger that queues readings before writing them to a card, benefit from that margin. With records of 64 bytes, a 256 KiB buffer holds 4,096 of them, and a decimal 0.25 MB buffer holds 3,906. Choosing the binary size gives a round record count that lines up with the card sector size.

Comparing with the megabyte-to-kilobyte page

The decimal conversion, MB to kB, multiplies by 1,000, and this page multiplies by 976.5625. The two results differ by 2.4 percent, the gap between a thousand and a kibi. A file of 3 MB is 3,000 kB and 2,929.69 KiB. If a form says it accepts files up to 2,048 KiB, which is 2,097,152 bytes, a 2.1 MB file at 2,100,000 bytes fails by a small margin. The kibibyte figure shows that outcome right away. A kB-based check would suggest the limit is 2,048 kB and give a nearly identical verdict, but only because the numbers are close.

Precision and presentation

KiB results often carry fractions, since 976.5625 has four decimals. For reports, round to the precision of the input. If the source says 3 MB, writing 2,930 KiB is enough. When the result goes into a configuration file or a memory map, use the exact byte count instead and note the KiB figure in a comment. Always spell the unit as KiB rather than KB in technical documents so that a reader knows you meant 1,024 bytes. If you convert a list of sizes, handle the whole list the same way, from the same starting unit, so that the column does not mix two definitions. A spreadsheet formula that multiplies by 976.5625 is simple to audit and to copy down a column, and a note beside the header that states the factor is enough documentation.

Alignment and page size overhead

The converter changes the unit and does nothing to the file. It does not account for alignment, page size or file system overhead, which can make real storage usage larger than the nominal figure. Treat the output as the size in binary units of the decimal megabyte amount you typed, and keep the original figure in your notes so that either number can be traced back. Label every figure you copy from the result, because a bare 976.5625 could be read as kilobytes by someone who sees it without context.