Kubernetes
size definitions
Gi vs G
computing units
Kubernetes storage

Kubernetes Gi vs G: what's the difference between the size units?

Codemia Knowledge Hub ·


"Gi" and "G" both mean roughly a gigabyte, but "Gi" is a binary unit (a power of 2) and "G" is a decimal unit (a power of 10). One Gi is 1,073,741,824 bytes and one G is 1,000,000,000 bytes, so a Gibibyte is slightly larger than a Gigabyte. Kubernetes accepts both when you set memory requests and limits.

## Binary (Gi, Mi, Ki) vs decimal (G, M, K) units

- **Binary prefixes (GiB, MiB, KiB)** are powers of 2:
  - 1 GiB (Gibibyte) = $2^{30}$ bytes = 1,073,741,824 bytes
  - 1 MiB (Mebibyte) = $2^{20}$ bytes = 1,048,576 bytes
  - 1 KiB (Kibibyte) = $2^{10}$ bytes = 1,024 bytes

- **Decimal prefixes (GB, MB, KB)** are powers of 10:
  - 1 GB (Gigabyte) = $10^9$ bytes = 1,000,000,000 bytes
  - 1 MB (Megabyte) = $10^6$ bytes = 1,000,000 bytes
  - 1 KB (Kilobyte) = $10^3$ bytes = 1,000 bytes

## What 2Gi and 2G allocate

- A memory request of `2Gi` allocates 2 Gibibytes, or 2,147,483,648 bytes.
- A memory request of `2G` allocates 2 Gigabytes, or 2,000,000,000 bytes.

The gap is small for one container but adds up across many containers in a large deployment.

## Why the unit choice matters

- **Cost**: misjudging the bytes actually requested can lead to unexpected costs in cloud environments that bill by usage.
- **Resource optimization**: confusing the units can cause over-allocation or under-allocation.
- **Consistency**: using one unit across teams keeps resource definitions aligned with expected usage.

Two mistakes come up often:

- **Defaulting to "G" out of familiarity**, which can lead to allocation errors when you meant binary units.
- **Losing precision**: applications with specific performance targets may need the exact amount defined by "Gi" or "Mi".

## Unit reference table

| Unit | Prefix Type | Bytes Equivalent | Kubernetes Notation |
| ----------- | -------------- | --------------------- | --------------------- |
| Gi | Binary | 1,073,741,824 bytes | 2Gi |
| G | Decimal | 1,000,000,000 bytes | 2G |
| Mi | Binary | 1,048,576 bytes | 1Mi |
| M | Decimal | 1,000,000 bytes | 1M |
| Ki | Binary | 1,024 bytes | 1Ki |
| k | Decimal | 1,000 bytes | 1k (lowercase; `1K` is invalid) |

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design