What are kilobytes (KB) and megabytes (MB)?
A kilobyte (KB) and a megabyte (MB) are units that measure amounts of digital information. Their numeric values, though, depend on which counting system you apply:
- Decimal (SI) system: works in base-10, so 1 KB = 1,000 bytes and 1 MB = 1,000,000 bytes.
- Binary (IEC) system: works in base-2, so 1 kibibyte (KiB) = 1,024 bytes and 1 mebibyte (MiB) = 1,048,576 bytes.
The ambiguity appears because “KB” and “MB” are frequently applied to both systems interchangeably. To remove this overlap, the IEC defined separate names such as “KiB” and “MiB” specifically for base-2 quantities.
Decimal vs. Binary systems: Key differences
Decimal (SI) system
- Adopted by storage vendors (for example, hard disks and flash drives).
- Matches the standard metric prefixes (kilo = 10³, mega = 10⁶).
- Formula:
Binary (IEC) system
- Common inside computing (for example, RAM and many operating systems).
- Matches powers of two (kibi = 2¹⁰, mebi = 2²⁰).
- Formula:
Conversion formulas
From KB to MB (SI)
From KiB to MiB (IEC)
Practical examples
Example 1: Decimal system
Converting a 4,500 KB file into MB:
Use case: A phone photo reported as 4,500 KB is the same as 4.5 MB.
Example 2: Binary system
Converting a 2,048 KiB file into MiB:
Use case: An installer that asks for 2,048 KiB of RAM needs 2 MiB.
Historical context
The base-2 convention grew out of early computer design, where memory addressing was built on powers of two. To end the resulting naming confusion, the IEC introduced the “KiB” and “MiB” labels in 1998. Even so, plenty of operating systems keep reporting sizes as “KB” or “MB” while computing them in binary, which produces mismatches. A drive sold as “1 TB” (1 trillion bytes, SI) shows up as roughly 931 GiB (binary) under Windows. By contrast, modern macOS reports file sizes in decimal (SI) units, which keeps them in line with how drives are advertised.
Common applications
- File storage: Work out how many 5 MB (SI) files fit on a 16 GB (SI) USB stick.
- Internet speeds: Translate a 500 MB (SI) download into kilobits for bandwidth math.
- RAM allocation: Express available memory in MiB when tuning software.
Notes
- Check the context: Drives report in SI units, while operating systems often count in binary.
- Unit labels: Prefer “KiB” or “MiB” when you need unambiguous technical wording.
- Rounding errors: Crossing between binary and decimal can introduce small gaps (for instance, 1 MiB ≈ 1.049 MB).
Frequently Asked Questions
How many KB are in an MB?
SI system:
Binary system:
Why does my 256 GB SSD show only 238 GB?
Vendors label drives with SI units (256 GB = 256,000,000,000 bytes), yet operating systems count in binary:
How to convert 5,000 KiB to MB?
- First turn KiB into bytes:
- Then turn bytes into MB (SI):
Are KB and KiB interchangeable?
No. A file of 1,000 KB comes out to about 976.56 KiB.
How long does a 100 MB file take to download at 10 Mbps?
- Convert MB to megabits (providers quote speeds in megabits per second, Mbit/s, using the decimal system):
- Work out the time: