DevKits

Data Size Converter — Bytes, KB, MB, GB, TB (SI & IEC)

Convert between bytes, KB, MB, GB, TB, PB and their IEC binary counterparts (KiB, MiB, GiB, TiB). Explains the SI vs IEC difference that causes 'my 1 TB drive shows 931 GB' confusion. 100% local.

Last updated:

Comments

SI (decimal, ×1000)

Used by hard-drive manufacturers, macOS Finder, network speeds.

BBytes1,000,000,000
KBKilobytes1,000,000
MBMegabytes1,000
GBGigabytes1
TBTerabytes0.001
PBPetabytes1.000e-6

IEC (binary, ×1024)

Used by RAM specs, Windows, most programming languages.

BBytes1,000,000,000
KiBKibibytes976,562.5
MiBMebibytes953.6743
GiBGibibytes0.931323
TiBTebibytes9.095e-4
PiBPebibytes8.882e-7
Why two columns? A “1 TB” hard drive holds 1,000,000,000,000 bytes (SI), but your OS may report it as ~931 GiB (IEC) — same file, different labels. IEC units (KiB / MiB / GiB, defined in IEC 80000-13) make it explicit that ×1024 is meant. Software that says “GB” but means “GiB” is a very common source of storage confusion.

Frequently Asked Questions

Why does my 1 TB drive show as 931 GB in Windows?

Drive manufacturers use SI units (1 TB = 1,000,000,000,000 bytes). Windows and most operating systems display capacity in IEC binary units but still call them GB (technically GiB, 1 GiB = 1,073,741,824 bytes). 1 TB / 1024³ ≈ 931 GiB — same drive, different accounting.

What's the difference between KB and KiB?

KB (kilobyte, SI) = 1,000 bytes. KiB (kibibyte, IEC) = 1,024 bytes. IEC 80000-13 introduced the -bi- prefixes (kibi, mebi, gibi…) in 1998 so software can be explicit about ×1000 vs ×1024. RAM specs, most Linux tools, and older Windows use ×1024; disks, macOS Finder, and network bandwidth use ×1000.

Which one should I use in code?

Match the audience: user-facing storage labels usually use SI (matches the sticker on the drive), memory allocations and buffer sizes use IEC (matches how RAM is physically organized). Always name your variables and units to avoid ambiguity — 'bytes' as a plain number is safest.

Related Tools