Byte Conversion Calculator

Convert a data size between bytes, kilobytes, megabytes, and gigabytes.

Supports 26 decimal, bit, and binary units with bidirectional conversion.

Updated August 13, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction / overview

Byte Conversion Calculator converts any data size between bytes, kilobytes, megabytes, gigabytes, and the rest of the digital-information units — 26 in total. Every field is editable: type a value into any one of them and all the others update at once, so you never have to work out the factor yourself.

The last field, “Value in other multiples of the byte,” holds the full list: decimal multiples (kB, MB, GB, TB…), bit units (kbit, Mbit, Gbit…), and binary multiples (KiB, MiB, GiB…). That is where you reach for when your figure is in terabytes, megabits, or gibibytes.

It is the tool to use when you are estimating how many photos fit on a card, comparing a file size you saw in a download manager with your storage, or double-checking a number in a log, spec sheet, or network report. Conversions are exact — the calculator never rounds a result to make it fit.

How to use / quick start

1

Type the size you know into any field

Put the number in the field whose unit matches what you have — for example 2 in Value in gigabytes. A plain number works; the fields accept comma-grouped input such as 2,000,000,000 too.

2

Read the equivalent values

The other fields fill in automatically, so the same size appears in bytes, kilobytes, and megabytes at the same time. You can keep the number and pick whichever unit you need for your answer.

3

Switch the last field to a binary unit when you need one

By default the “other multiples” field reads in terabytes. If your result should be in KiB, MiB, or GiB, choose that unit from the field’s unit list — the value re-reads in binary multiples, which is what most operating systems report for files and drives.

Example — convert 2 GB into megabytes, kilobytes, and bytes

Type 22 in the Value in gigabytes field. Because these are decimal multiples, each smaller unit is exactly one thousandth of the one above it:

2 GB2\ \mathrm{GB} = \ =\ 2×109 B2 \times 10^9\ \mathrm{B} = \ =\ 2000000000 B2\,000\,000\,000\ \mathrm{B} = \ =\ 2000000 kB2\,000\,000\ \mathrm{kB} = \ =\ 2000 MB2\,000\ \mathrm{MB}

The calculator shows the same figure as 2,000,000,000 bytes, 2,000,000 kilobytes, and 2,000 megabytes. To read it in binary units instead, switch the last field to GiB — it then reports about 1.86 GiB, because a gigabyte and a gibibyte are not the same size (more on that below).

Calculation method

Every unit in this calculator is defined by how many bytes it contains — call that factor ff. To convert, the value is first carried to bytes, then divided by the target unit’s factor. Because every factor is an exact integer (or an exact eighth for bit units), the conversion never introduces rounding.

NB=NsfsN_{\mathrm{B}} = N_s \cdot f_s  ,  \ \ ,\ \ Nt=NBft=NsfsftN_t = \frac{N_{\mathrm{B}}}{f_t} = N_s \cdot \frac{f_s}{f_t}

The decimal multiples are powers of one thousand:

1 kB=103 B1\ \mathrm{kB} = 10^3\ \mathrm{B} , \ ,\ 1 MB=106 B1\ \mathrm{MB} = 10^6\ \mathrm{B} , \ ,\ 1 GB=109 B1\ \mathrm{GB} = 10^9\ \mathrm{B} , \ ,\ 1 TB=1012 B1\ \mathrm{TB} = 10^{12}\ \mathrm{B}

The binary multiples are powers of two, named with an “i” in the prefix:

1 KiB1\ \mathrm{KiB}==2102^{10}==1024 B1024\ \mathrm{B} , \ ,\ 1 MiB1\ \mathrm{MiB}==2202^{20}==1048576 B1\,048\,576\ \mathrm{B} , \ ,\ 1 GiB1\ \mathrm{GiB}==2302^{30}==1073741824 B1\,073\,741\,824\ \mathrm{B}

Bit units follow the same prefixes but start from the bit, and one byte holds exactly 8 bits. That makes a kilobit 103 bit10^3\ \mathrm{bit} = 125 B125\ \mathrm{B}, and a kibibit 210 bit2^{10}\ \mathrm{bit} = 128 B128\ \mathrm{B}.

1 B1\ \mathrm{B}==8 bit8\ \mathrm{bit} , \ ,\ 1 kbit1\ \mathrm{kbit}==103 bit10^3\ \mathrm{bit}==125 B125\ \mathrm{B} , \ ,\ 1 Kibit1\ \mathrm{Kibit}==210 bit2^{10}\ \mathrm{bit}==128 B128\ \mathrm{B}

Variables

  • NsN_s — the numeric value in the source unit
  • NtN_t — the numeric value in the target unit
  • fsf_s — bytes per source unit
  • ftf_t — bytes per target unit
  • NBN_{\mathrm{B}} — the size carried through to bytes

Every field is a valid starting point. Enter a value in the kilobytes field and the others re-derive from it, so the conversion runs equally well in either direction.

Decimal vs. binary units

The single most common reason people reach for this tool is the gap between decimal and binary multiples. Storage and network gear is normally rated in decimal units — 1 GB=109 B1\ \mathrm{GB} = 10^9\ \mathrm{B} — while memory and most operating systems report file sizes in binary units — 1 GiB=230 B1\ \mathrm{GiB} = 2^{30}\ \mathrm{B}. The two diverge more with every step up the scale, which is why the numbers never quite match.

Why a “500 GB” drive shows about 465 GB

A drive sold as 500 GB holds 500 billion bytes. When the operating system divides that by 2302^{30} (gibibytes) but keeps the “GB” label, the result looks like a shortfall:

500 GB=500×109 B=500000000000 B500\ \mathrm{GB} = 500 \times 10^9\ \mathrm{B} = 500\,000\,000\,000\ \mathrm{B}  \ \Rightarrow\ 500000000000230\frac{500\,000\,000\,000}{2^{30}}  \ \approx\ 465.66 GiB465.66\ \mathrm{GiB}

Nothing is missing — the drive has the advertised byte count. It is just being measured with a different ruler. This calculator shows both numbers side by side: enter 500 in the gigabytes field, then read the “other multiples” field in both GB and GiB to see the difference yourself.

The decimal prefixes (kB, MB, GB, TB) are the standard SI prefixes for one thousand. The binary prefixes (KiB, MiB, GiB, TiB) were adopted by the IEC so that 10241024-based sizes could be named unambiguously; the NIST reference on binary prefixes lists both systems side by side, including the byte-to-bit relationship.

Choose decimal for storage and network specs

Hard drives, SSDs, memory cards, cloud storage plans, and bandwidth/throughput figures are almost always quoted in decimal units (GB, TB, Gbit/s). Use kB, MB, GB, TB to match those numbers directly.

Choose binary for memory and much OS reporting

RAM sizes and the file sizes shown by most operating systems and file managers use binary multiples (KiB, MiB, GiB) even when the label only says “KB” or “GB.” Pick KiB/MiB/GiB when you want your result to line up with what your system displays.

Bits are for rates, bytes for sizes

Network speeds are quoted in bits per second (Mbit/s, Gbit/s), while files and storage are sized in bytes. Because 1 B=8 bit1\ \mathrm{B} = 8\ \mathrm{bit}, a 100 Mbit/s100\ \mathrm{Mbit/s} connection moves at most 12.5 MB/s12.5\ \mathrm{MB/s} in file terms.

If you are starting from a piece of text and want its exact size in bytes first, the text statistics tool reports the UTF-8 byte length of any text — paste the result here and convert it into whatever unit you need.

Frequently asked questions

What is the difference between kB and KiB?

One kilobyte is exactly 10001000 bytes, while one kibibyte is exactly 10241024 bytes — about 2.4% more. The gap grows with each prefix: a megabyte is 10610^6 bytes but a mebibyte is 220=10485762^{20} = 1\,048\,576 bytes, and so on. The “other multiples” field in this calculator includes both so you can compare them directly.

Why does my 500 GB drive only show about 465 GB?

The drive genuinely holds 500 billion bytes. Manufacturers quote capacity in decimal gigabytes (10910^9 bytes), while the operating system divides by 2302^{30} (gibibytes) and keeps the “GB” label — so 500 GB comes out as roughly 465.66 GiB. It is a units mismatch, not missing storage.

How many bytes is a megabyte — and how do bits fit in?

A decimal megabyte is 10000001\,000\,000 bytes and a binary mebibyte is 10485761\,048\,576 bytes. Bits are the smaller unit: one byte holds exactly 88 bits, so a megabit is 125000125\,000 bytes. This calculator covers both bytes and bits, including the binary bit units (Kibit, Mibit, Gibit, Tibit).

Limitations

This calculator accepts non-negative numbers only; a negative size shows a “Data size cannot be negative.” message and is not converted. The conversion itself is exact — every unit factor is a precise value, so no rounding is introduced by the math. What the tool cannot do is guess which system you mean: decimal (kB, MB, GB) and binary (KiB, MiB, GiB) are different sizes, so check the unit you are reading before relying on the number. For the same reason, quoted storage and network figures should always be treated in the unit they were advertised in.

Byte Conversion Calculator – Convert B, kB, MB, GB & More