Skip to content
K Knidox Search…
Computer Science · Data

Data Storage Converter

Convert between bits, bytes, KB, MB, GB, and TB — in both decimal and binary.

The quantity to convert.
From unitThe unit your amount is in.
Prefix base
Common sizes — tap to try
1 GB equals · decimal (SI)
bits8,000,000,000
bytes1,000,000,000
KB (kilobytes)1,000,000
MB (megabytes)1,000
GB (gigabytes)1
TB (terabytes)0.001

1 GB = 1000 MB = 1,000,000,000 bytes using decimal (SI) prefixes, while 1 GiB = 1024 MiB = 1,073,741,824 bytes using binary (IEC) prefixes. This converter switches between both interpretations and also handles bits, where 8 bits make 1 byte — so the same amount can read differently depending on which base you choose.

Two ways to read a unit like “MB”

Digital storage is counted in bytes, and a byte is 8 bits. Larger amounts use prefixes — kilo, mega, giga, tera — but those prefixes have two competing definitions. The decimal (SI) system treats each step as a power of 1000, so 1 KB = 1000 bytes. The binary (IEC) system treats each step as a power of 1024 and renames the units KiB, MiB, GiB, TiB, so 1 KiB = 1024 bytes. The gap is small at the kilobyte level but grows with each step: a binary terabyte is about 10% larger than a decimal one.

bytes = amount × basen, base = 1000 or 1024

1 byte = 8 bits · n is the prefix step (KB = 1, MB = 2, GB = 3, TB = 4)

Worked example: 2 GiB in bytes

With the binary base, a gigabyte sits three steps above a byte, so multiply by 1024 three times.

  1. 1
    Pick the base. Decimal uses 1000 per step (KB, MB, GB); binary uses 1024 (KiB, MiB, GiB). Here we use binary.
  2. 2
    Find the prefix step n. A gigabyte is three steps above a byte, so n = 3 and the multiplier is 1024³ = 1,073,741,824.
  3. 3
    Multiply the amount into bytes. 2 × 1,073,741,824 = 2,147,483,648 bytes.
  4. 4
    Convert to other units as needed. For bits, multiply by 8: 2,147,483,648 × 8 = 17,179,869,184 bits.

Decimal vs binary prefixes

Exact byte counts for each prefix in both systems.

PrefixDecimal (SI)Binary (IEC)
KiloKB = 1,000 bytesKiB = 1,024 bytes
MegaMB = 1,000,000 bytesMiB = 1,048,576 bytes
GigaGB = 1,000,000,000 bytesGiB = 1,073,741,824 bytes
TeraTB = 1,000,000,000,000 bytesTiB = 1,099,511,627,776 bytes

Why your 1 TB drive “loses” space

Drive and flash-memory makers advertise capacity in decimal units, so a “1 TB” drive holds 1,000,000,000,000 bytes. Most operating systems — Windows in particular — still divide by 1024 and label the result with the old “TB” symbol, reporting roughly 0.909 of that, about 931 GiB. Nothing is missing; the same byte count is just being divided by 1024 instead of 1000. macOS and Linux switched to decimal reporting years ago, which is why the same drive can show a different “size” on different machines. Knowing which base a tool uses is the only way to compare two figures fairly.

What is the difference between KB and KiB?
KB is the decimal kilobyte, defined as 1000 bytes. KiB is the binary kibibyte, defined as 1024 bytes. The IEC introduced KiB, MiB, GiB so the two definitions would stop sharing the same symbol.
How many bytes are in 1 GB versus 1 GiB?
1 GB is exactly 1,000,000,000 bytes (1000³). 1 GiB is exactly 1,073,741,824 bytes (1024³). The binary gigabyte is about 7.4% larger than the decimal one.
How do bits relate to bytes here?
One byte is 8 bits, in both the decimal and binary systems. To turn a byte figure into bits, multiply by 8; to go from bits to bytes, divide by 8. Network speeds are usually quoted in bits per second, storage in bytes.
Which base should I choose?
Use decimal (1000) to match advertised drive sizes, file managers on macOS and Linux, and most networking specs. Use binary (1024) to match RAM sizes and the space figures Windows still reports.
Why does Windows show a smaller size than the box?
Windows counts in powers of 1024 but labels the result with decimal-looking symbols like GB. A drive sold as 1 TB (1,000,000,000,000 bytes) divided by 1024³ reads as about 931 — which Windows prints as “931 GB”.
Is a megabit the same as a megabyte?
No. A megabyte (MB) is roughly eight times a megabit (Mb), because a byte is 8 bits. A 100 Mb/s connection therefore transfers at most about 12.5 MB/s, before any protocol overhead.