HomeUnit Conversion › Data Storage Converter

Data Storage Converter

Converts digital storage and transfer sizes between bits, bytes, decimal SI multiples (KB = 1000 B, MB, GB, TB, PB), binary IEC multiples (KiB = 1024 B, MiB, GiB, TiB, PiB) and kilobit/megabit/gigabit/terabit.

When to use

You need a file, disk or memory size in another unit, e.g. GB to GiB, MB to bits or TB to GB, or want to explain why a '1 TB' drive shows as 931 GiB.

Do not use when: You need transfer time from size and bandwidth (use download-time) or a number in binary/hex (use base-converter).

Formula

result = value × factor, factor = (1 from_unit in B) / (1 to_unit in B)

KB/MB/GB/TB/PB follow the SI decimal prefixes (powers of 1000, as used by drive manufacturers and IEC 80000-13); KiB/MiB/GiB/TiB/PiB are binary (powers of 1024, as most operating systems report). 1 byte = 8 bits.

Inputs

ParameterTypeUnitRequiredDescription
valuenumberyesAmount to convert, expressed in from_unit.
from_unitenum: bit | B | KB | MB | GB | TB | PB | KiB | MiB | GiB | TiB | PiB | kbit | Mbit | Gbit | TbityesUnit of the input value. Accepted symbols: bit, B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB, kbit, Mbit, Gbit, Tbit; spelled-out names and common abbreviations are accepted too.
to_unitenum: bit | B | KB | MB | GB | TB | PB | KiB | MiB | GiB | TiB | PiB | kbit | Mbit | Gbit | TbityesUnit to convert into (same symbols as from_unit).

Outputs

OutputTypeUnitDescription
resultnumberConverted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values).
result_textstringThe conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km".
formulastringRelation used, e.g. "1 mi = 1.609344 km".
factornumberMultiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions.
conversion_tableobjectThe input value expressed in every supported data storage unit (6 significant figures), keyed by unit symbol.

Example

1 GB to GiB: {"value":1,"from_unit":"GB","to_unit":"GiB"}{"result":0.931323,"formula":"1 GB = 0.9313225746 GiB","conversion_table":{"MB":1000,"MiB":953.674,"bit":8000000000}}

500 MB to megabits: {"value":500,"from_unit":"MB","to_unit":"Mbit"}{"result":4000,"factor":8,"conversion_table":{"GB":0.5,"MiB":476.837}}

GET https://tttkmbb.com/api/v1/calculate/data-storage?value=1&from_unit=GB&to_unit=GiB

Machine access

Sources

FAQ

Is 1 KB 1000 or 1024 bytes?

Here KB = 1000 bytes (SI) and KiB = 1024 bytes (IEC). Windows labels 1024-byte units as 'KB', which is why a 1 TB (10^12 B) drive shows as 931 GiB.

How do I enter megabits?

Use Mbit, kbit, Gbit or Tbit (or 'megabits'). Bandwidth figures such as 100 Mbps are megabits per second; divide by 8 for MB per second.

Related calculators