Skip to content
BetterDL

Binary prefixes (KiB, MiB, GiB)

Also called: binary prefix, KiB, MiB, GiB, kibibyte, mebibyte, gibibyte, IEC prefixes

Unit prefixes based on powers of 2: kibi (Ki) = 2¹⁰ = 1024, mebi (Mi) = 2²⁰ and gibi (Gi) = 2³⁰. So 1 KiB is exactly 1024 bytes.

Memory sizes come in powers of 2, but the everyday prefixes kilo, mega and giga mean powers of 10. The binary prefixes remove the ambiguity:

  • Ki (kibi) = 2¹⁰ = 1,024
  • Mi (mebi) = 2²⁰ = 1,048,576
  • Gi (gibi) = 2³⁰ = 1,073,741,824

So 1 KiB is exactly 1024 bytes, 1 MiB is 2²⁰ bytes, and 1 GiB is 2³⁰ bytes.

Why it matters: "64 KB" can mean 64,000 bytes or 65,536 bytes, depending on who wrote it. A disk maker usually means the first, a memory chip the second. KiB always means the second.

On this site, the K, M and G inside memory notation (1K × 8, 64K words) are powers of 2, and byte capacities are given in KiB, MiB and GiB.

Working with them is easy in powers of 2. Write the number as 2ᵃ × prefix and add exponents: 16 KiB = 2⁴ × 2¹⁰ = 2¹⁴ bytes, 512 MiB = 2⁹ × 2²⁰ = 2²⁹ bytes. In a byte-addressable memory, that exponent is the number of address bits.

Worked examples

Example

Address bits for 512 MiB

A byte-addressable memory holds 512 MiB.

  1. 1.

    512 = 2⁹ and Mi = 2²⁰.

  2. 2.

    512 MiB = 2⁹ × 2²⁰ = 2²⁹ bytes.

  3. 3.

    Each address holds one byte, so 29 address bits.

Example

Capacity of a 16K × 32 memory in KiB

Convert words × bits to KiB.

  1. 1.

    Bits: 16K × 32 = 2¹⁴ × 2⁵ = 2¹⁹.

  2. 2.

    Bytes: 2¹⁹ ÷ 2³ = 2¹⁶.

  3. 3.

    KiB: 2¹⁶ ÷ 2¹⁰ = 2⁶ = 64 KiB.

Common mistakes

  • Reading KiB as 1000 bytes. It is always 1024.

  • Mixing bits and bytes. KiB counts bytes; divide a bit count by 8 first.

  • Assuming every "KB" is 1024 bytes. Without the i, check the context.

Practice Binary prefixes (KiB, MiB, GiB)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Binary prefixes (KiB, MiB, GiB) is taught in Memory and Number Systems.