What are data storage units?

Data is counted in bits and bytes. A bit is a single 0 or 1, and a byte is 8 bits. Larger amounts take a prefix, and there are two sets of them:

  • Decimal prefixes, the SI prefixes of the metric system, go up in steps of 1000: a kilobyte (kB) is 1000 bytes, a megabyte (MB) 1000 kilobytes, then gigabytes (GB), terabytes (TB), petabytes (PB), exabytes (EB), zettabytes (ZB) and yottabytes (YB).
  • Binary prefixes go up in steps of 1024: a kibibyte (KiB) is 1024 bytes, a mebibyte (MiB) 1024 kibibytes, then gibibytes (GiB), tebibytes (TiB), pebibytes (PiB), exbibytes (EiB), zebibytes (ZiB) and yobibytes (YiB). Their symbols have an "i" after the first letter.

Tool description

This tool converts data sizes between bits, bytes, and both with every decimal prefix from kilo to yotta and every binary prefix from kibi to yobi, 34 units in all. Every data storage converter here works the same way, from the general Data Storage Unit Converter to the ones for a single pair, such as megabytes to gigabytes or gibibytes to gigabytes: it starts on the units in its name, and the Source and Target menus switch to any of the 34 units. Type in a menu to find a unit by its name or symbol, such as "MiB". Type a number and the result appears as you type, ready to copy. The swap button turns the conversion around.

Units

Decimal unit In bytes Binary unit In bytes
Kilobyte (kB) 10³ = 1,000 Kibibyte (KiB) 2¹⁰ = 1,024
Megabyte (MB) 10⁶ = 1,000,000 Mebibyte (MiB) 2²⁰ = 1,048,576
Gigabyte (GB) 10⁹ = 1,000,000,000 Gibibyte (GiB) 2³⁰ = 1,073,741,824
Terabyte (TB) 10¹² Tebibyte (TiB) 2⁴⁰ = 1,099,511,627,776
Petabyte (PB) 10¹⁵ Pebibyte (PiB) 2⁵⁰ = 1,125,899,906,842,624
Exabyte (EB) 10¹⁸ Exbibyte (EiB) 2⁶⁰ = 1,152,921,504,606,846,976
Zettabyte (ZB) 10²¹ Zebibyte (ZiB) 2⁷⁰ = 1,180,591,620,717,411,303,424
Yottabyte (YB) 10²⁴ Yobibyte (YiB) 2⁸⁰ = 1,208,925,819,614,629,174,706,176

The same units in bits are the kilobit (kbit) to the yottabit (Ybit) and the kibibit (Kibit) to the yobibit (Yibit), each an eighth of the byte unit with the same prefix.

Examples

Size Converted
1 GB 1000 MB
1 GiB 1024 MiB
1 GiB 1073.741824 MB
1 TB 931.3225746154785 GiB
500 GB 465.6612873077393 GiB
1 TiB 1.099511627776 TB
1 kB 0.9765625 KiB
1 MB 8 Mbit
100 Mbit 12.5 MB
1 PiB 1125899906842624 B

How it works

The conversion is done by mathjs, a JavaScript math library, with its decimal and binary prefixes. It counts with exact decimal numbers and fractions rather than floating point numbers, so an amount such as 0.1 kB converts to exactly 100 B, and each result is rounded to 16 significant digits, which hold all of the 1125899906842624 bytes of a pebibyte. Results from 10¹⁶ on are written in exponent notation, so that every digit shown is significant: 1 EiB shows as 1.152921504606847e+18 B. So are results below 0.000001, such as 1.25e-13 TB for 1 bit.

Tips

  • To turn a speed in megabits per second into megabytes per second, convert megabits to megabytes: 100 Mbit is 12.5 MB, so 100 Mbit/s is 12.5 MB/s.