Storage Measurement Units (KiB, MiB, GiB)

In digital computing, data capacity and memory size are quantified using a hierarchy of units. Understanding these units and calculating conversions accurately is an essential computer science skill.


Learning Objectives

  • Order and define the hierarchy of digital storage units from bit to tebibyte.
  • Distinguish between IEC binary prefixes (multiples of $1,024$) and SI decimal prefixes (multiples of $1,000$).
  • Accurately convert values between bits, bytes, and binary storage units.
  • Calculate data transmission and file transfer durations.

The Fundamental Building Blocks

  1. Bit (b): The smallest atomic unit of digital data. A binary digit with a value of either 0 or 1.
  2. Nibble: A group of 4 bits (e.g., 1011). Conveniently corresponds to exactly one hexadecimal digit.
  3. Byte (B): A group of 8 bits (e.g., 10110010). Standard unit used to measure character storage and memory addressing.

IEC Binary Prefixes vs SI Decimal Prefixes

Historically, the terms "kilobyte" or "megabyte" were loosely used for both 1,000 and 1,024 bytes, creating widespread ambiguity between hard drive manufacturers and operating systems.

To resolve this, international standards organizations (IEC and IEEE) established binary prefixes to represent exact powers of 2 ($2^{10} = 1,024$):

Unit Name

Abbreviation

Binary Calculation (IEC)

Equivalent in Bytes

Equivalent in Previous Unit

Byte

$\text{B}$

$2^0$

$1\text{ byte}$

$8\text{ bits}$

Kibibyte

$\text{KiB}$

$2^{10}$

$1,024\text{ bytes}$

$1,024\text{ B}$

Mebibyte

$\text{MiB}$

$2^{20} = 1,024^2$

$1,048,576\text{ bytes}$

$1,024\text{ KiB}$

Gibibyte

$\text{GiB}$

$2^{30} = 1,024^3$

$1,073,741,824\text{ bytes}$

$1,024\text{ MiB}$

Tebibyte

$\text{TiB}$

$2^{40} = 1,024^4$

$1,099,511,627,776\text{ bytes}$

$1,024\text{ GiB}$

Pebibyte

$\text{PiB}$

$2^{50} = 1,024^5$

$\approx 1.126 \times 10^{15}\text{ bytes}$

$1,024\text{ TiB}$

Exbibyte

$\text{EiB}$

$2^{60} = 1,024^6$

$\approx 1.153 \times 10^{18}\text{ bytes}$

$1,024\text{ PiB}$

Contrast with SI Decimal Units:

  • SI Prefixes (Base 10):
  • $1\text{ kB (kilobyte)} = 10^3 = 1,000\text{ bytes}$
  • $1\text{ MB (megabyte)} = 10^6 = 1,000,000\text{ bytes}$
  • $1\text{ GB (gigabyte)} = 10^9 = 1,000,000,000\text{ bytes}$
  • $1\text{ TB (terabyte)} = 10^{12} = 1,000,000,000,000\text{ bytes}$

Note: Why Computers Use Binary Prefixes: Computer memory (RAM) is organized in physical rows and columns driven by binary address lines ($k$ address lines can address exactly $2^k$ distinct bytes). Thus, internal computer architectures inherently double and scale in powers of 2, making $1,024$ the natural multiplier.


Unit Conversion Rules

When converting between binary storage units:

  • Going from Larger unit $\to$ Smaller unit: Multiply by $1,024$ for each step down.
  • Going from Smaller unit $\to$ Larger unit: Divide by $1,024$ for each step up.
  • Bytes $\leftrightarrow$ Bits: Multiply by 8 to get bits; divide by 8 to get bytes.
+-----+  *1024  +-----+  *1024  +-----+  *1024  +-------+  *8  +------+
| GiB | ----->  | MiB | ----->  | KiB | ----->  | Bytes | ---> | Bits |
|     | <-----  |     | <-----  |     | <-----  |       | <--- |      |
+-----+  /1024  +-----+  /1024  +-----+  /1024  +-------+  /8  +------+

Conversion Examples:

  1. Convert $4\text{ MiB}$ to bytes:
$$4 \times 1,024 = 4,096\text{ KiB}$$
$$4,096 \times 1,024 = 4,194,304\text{ bytes}$$
  1. Convert $16,384\text{ KiB}$ to $\text{MiB}$:
$$\frac{16,384}{1,024} = 16\text{ MiB}$$

Data Transfer Time Calculations

Network speeds and internet bandwidth are typically rated in bits per second (e.g., $100\text{ Mbps} = 100\text{ megabits per second}$), while files are measured in bytes or binary units ($\text{MiB}$).

To calculate how long it takes to transfer or download a file:

$$\text{Time (seconds)} = \frac{\text{File Size (bits)}}{\text{Transmission Speed (bits per second)}}$$

Worked Example:

Problem: How long will it take to download a $25\text{ MiB}$ software patch over a $40\text{ Mbps}$ broadband internet connection?

  1. Convert File Size to bits:
$$\text{File Size in bytes} = 25 \times 1,024 \times 1,024 = 26,214,400\text{ bytes}$$
$$\text{File Size in bits} = 26,214,400 \times 8 = 209,715,200\text{ bits}$$
  1. Express Transmission Speed in bits per second:
$$\text{Speed} = 40\text{ Mbps} = 40 \times 10^6 = 40,000,000\text{ bits/second}$$
  1. Calculate Transfer Duration:
$$\text{Time} = \frac{209,715,200}{40,000,000} \approx 5.24\text{ seconds}$$

Written practice and self-review

A user purchases a hard drive advertised as 2 GB (Gigabytes) and notes that an operating system reports its capacity as approximately 1.86 GiB (Gibibytes).

  1. Explain the mathematical difference between 1 GB and 1 GiB.
  2. Calculate the exact number of bytes in 2 GiB.
  3. Explain why computer memory (such as RAM) is engineered and measured using binary prefixes rather than decimal units.

Write an explanation before checking the theory. Check that each claim answers the question, uses the correct concept and explains why it applies. Discuss uncertain points with a teacher. The structured exercise below checks specific facts; it does not automatically mark this explanation.

AI Socratic Tutor

All-Access
Sign in or create an account. AI Tutor is an All-Access benefit.
Sign Up

Need guidance? Ask a question or use the hint below.

AI Socratic Tutor is an All-Access Benefit

Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.

You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.

Application: Check the reasoning

+30 XP

Application: Check the reasoning

  1. Bytes in 3 KiB: [Space 1]
  2. Bits in 256 bytes: [Space 2]
  3. KiB in 2 MiB: [Space 3]
Word Bank / Available Cards (Drag into spaces or tap to place)

Sign in or create a free account to test your solution and track XP.