What are kilobytes (KB) and megabytes (MB)?
A kilobyte (KB) and megabyte (MB) are units of digital information storage. However, their exact values depend on the measurement system used:
- Decimal (SI) system: Uses base-10, where 1 KB = 1,000 bytes and 1 MB = 1,000,000 bytes.
- Binary (IEC) system: Uses base-2, where 1 kibibyte (KiB) = 1,024 bytes and 1 mebibyte (MiB) = 1,048,576 bytes.
Confusion arises because “KB” and “MB” are often incorrectly used for both systems. For clarity, the IEC standard introduced distinct terms like “KiB” and “MiB” for binary measurements.
Decimal vs. Binary systems: Key differences
Decimal (SI) system
- Used by storage manufacturers (e.g., hard drives, USB drives).
- Aligns with metric prefixes (kilo = 10³, mega = 10⁶).
- Formula:
Binary (IEC) system
- Used in computing (e.g., RAM, operating systems).
- Aligns with 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
A 4,500 KB file converts to MB as:
Use case: A smartphone photo labeled as 4,500 KB equals 4.5 MB.
Example 2: Binary system
A 2,048 KiB file converts to MiB as:
Use case: A game installer requiring 2,048 KiB of RAM uses 2 MiB.
Historical context
The binary system originated from early computing, where memory addressing relied on powers of two. In 1998, the IEC standardized terms like “KiB” and “MiB” to resolve ambiguity. Despite this, many operating systems still report file sizes in “KB” or “MB” while using binary calculations, leading to discrepancies. For example, a “1 TB” hard drive marketed as 1 trillion bytes (SI) appears as ~931 GiB (binary) in Windows. Modern operating systems, such as macOS, use decimal units (SI) to display file sizes to avoid confusion with drive marketing.
Common applications
- File storage: Determine how many 5 MB (SI) files fit in a 16 GB (SI) USB drive.
- Internet speeds: Convert a 500 MB (SI) download to kilobits for speed calculations.
- RAM allocation: Calculate available memory in MiB for software optimization.
Notes
- Check the context: Storage devices use SI units; operating systems often use binary.
- Unit labels: Use “KiB” or “MiB” for clarity in technical writing.
- Rounding errors: Binary-to-decimal conversions may show slight discrepancies (e.g., 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?
Storage manufacturers use SI units (256 GB = 256{,}000{,}000{,}000 bytes), but operating systems use binary:
How to convert 5,000 KiB to MB?
- Convert KiB to bytes:
- Convert bytes to MB (SI):
Are KB and KiB interchangeable?
No. A 1,000 KB file equals approximately 976.56 KiB.
How long does a 100 MB file take to download at 10 Mbps?
- Convert MB to megabits (Internet providers use megabits per second (Mbit/s) in the decimal system):
- Calculate time: