What it does
This converts between bytes and the two families of storage units: decimal (KB, MB, GB, TB) and binary (KiB, MiB, GiB, TiB). It also answers a very common question: why a new "1 TB" drive shows up as about 931 GB on a computer.
How it's calculated
Decimal units use the SI prefixes, as NIST defines them: kilo = 10³, mega = 10⁶, giga = 10⁹, tera = 10¹². Binary units use the IEC prefixes adopted in 1998: kibi = 2¹⁰, mebi = 2²⁰, gibi = 2³⁰, tebi = 2⁴⁰.
1 KiB = 1,024 bytes · 1 MiB = 1,048,576 · 1 GiB = 1,073,741,824 · 1 TiB = 2⁴⁰ = 1,099,511,627,776
To convert, multiply by the first unit's size in bytes and divide by the second's. A byte is 8 bits.
Why does my 1 TB drive show 931 GB?
Storage makers measure capacity in decimal units, so a 1 TB drive holds 1,000,000,000,000 bytes. Some operating systems and apps count in binary units but still label them "GB". Divide by 1,073,741,824 bytes per GiB:
No space is missing. It's the same number of bytes in a different unit. The formatted file system takes a little more, so the free space you see on a new drive is slightly lower still.
| Advertised | Bytes | In binary GB (GiB) | In binary TB (TiB) |
|---|---|---|---|
| 128 GB | 128,000,000,000 | 119.21 GiB | 0.12 TiB |
| 256 GB | 256,000,000,000 | 238.42 GiB | 0.23 TiB |
| 500 GB | 500,000,000,000 | 465.66 GiB | 0.45 TiB |
| 1 TB | 1,000,000,000,000 | 931.32 GiB | 0.91 TiB |
| 2 TB | 2,000,000,000,000 | 1,862.65 GiB | 1.82 TiB |
| 4 TB | 4,000,000,000,000 | 3,725.29 GiB | 3.64 TiB |
Worked example
A 500 GB SSD is 500 × 10⁹ = 500,000,000,000 bytes. 500,000,000,000 ÷ 1,073,741,824 = 465.66 GiB. The gap grows with each prefix: about 2.4% for kilo vs. kibi, 4.9% for mega, 7.4% for giga and 9.95% for tera.
Limitations
- "MB" is sometimes used for 1,048,576 bytes, especially for memory (RAM) and in older software. When the meaning matters, the binary prefixes remove the doubt.
- Network and internet speeds use bits per second (Mbps), not bytes. Divide by 8 to get bytes.
- Results with more than 15 significant digits are rounded.