Decimal vs binary prefixes (KB vs KiB, MB vs MiB)

Data 閱讀 5 min

Why a "1 TB" drive is not 1,024 GB, and what the IEC binary prefixes fixed in 1998.

There's a long-standing mess in computing: KB is sometimes 1000 bytes, sometimes 1024 bytes. The mess is so pervasive that the IEC standardised the binary prefixes in 1998 to disambiguate them.

The decimal prefix (SI)

These follow the standard SI decimal naming:

- kB = 10³ = 1000 bytes - MB = 10⁶ = 1,000,000 bytes - GB = 10⁹ = 1,000,000,000 bytes - TB = 10¹² = 1,000,000,000,000 bytes

The binary prefix (IEC, 1998)

These were introduced to mean 2^n:

- KiB = 2¹⁰ = 1024 bytes (kibibyte) - MiB = 2²⁰ = 1,048,576 bytes (mebibyte) - GiB = 2³⁰ = 1,073,741,824 bytes (gibibyte) - TiB = 2⁴⁰ = 1,099,511,627,776 bytes (tebibyte)

Which to use

- Disk drives advertise GB (decimal). A "1 TB" drive is 1,000,000,000,000 bytes; your operating system reports it in TiB (~931 GiB), which makes it look smaller than the box promised. - RAM has always been sold in binary GB (now GiB formally), so the operating system matches. - Networking speeds use kb/s (kilobit per second) — that's 1000 bits, and there are 8 bits in a byte, so 1 Mbps = 125 KB/s. - Data-transfer utilities historically use binary prefixes. A file of "1 MB" reported by a downloader might mean 1,000,000 bytes (decimal) or 1,048,576 bytes (binary) depending on the tool.

Practical recommendation

When you want accuracy, treat KB = 1000 bytes (decimal) and KiB = 1024 bytes (binary). The site lets you convert between both systems explicitly.