If you are working with data related to storage space or file-size, you will often need to convert between units.

You might intend on using the data in calculations or you might just want all the sizes to be displayed in the same unit.

This would require you to convert the sizes, say bytes to MB / GB or vice-versa.

In this tutorial, we will show you two different ways to **convert bytes to MB or GB** and vice-versa in Excel:

Table of Contents

**Using the Basic Conversion Formulae to Convert Bytes to MB/GB**

The basic method requires you to understand the relationship between the storage units and how to convert from one to the other.

In general, every unit grows by 1024. This means,

- 1024 Bytes = 1 KB
- 1024 KB = 1 MB
- 1024 MB = 1 GB

And so on!

In other words, if you want to convert a storage size from *bytes *to *MB*, you need to divide it with **102 * 1024**. Similarly, to convert it to *GB*, you need to divide it by **1024 * 1024 * 1024.**

Conversely, if you want to convert back, you need to *multiply *the storage size by **1024 **each time.

This means, to convert from *MB *to *Bytes*, you need to multiply by **1024 * 1024**. Similarly, to convert from *GB *to *Bytes*, multiply the number with **1024 * 1024 * 1024**.

**Converting Bytes to MB and Vice versa**

Let us say you have the following numbers in bytes and want to convert all of them to MB:

To convert from *Bytes *to *MB*, use the following formula (for row 2):

=A2 /( 1024 * 1024)

To convert from *MB *to *Bytes*, reverse the formula as follows (for row 2):

=A2 * 1024 * 1024

Note, instead of multiplying by **1024 **so many times, you could also use the POWER function as follows:

=A2 / POWER(1024,2)

Or

=A2 * POWER(1024,2)

**Converting Bytes to GB and Vice versa**

If you have the same numbers in *Bytes *and want to convert all of them to *GB *instead, use the following formula (for row 2):

=A2 /( 1024 * 1024 * 1024)

To convert from *GB *to *Bytes*, reverse the formula as follows (for row 2):

=A2 * 1024 * 1024 * 1024

Alternatively, you could use the POWER function as follows:

=A2 / POWER(1024,3)

Or

=A2 * POWER(1024,3)

**Converting MB to GB and Vice versa**

Now consider the case where you have the following numbers in *MB *instead and want to convert all of them to *GB*:

In this case, you can use the following formula (for row 2):

=A2 /( 1024)

To convert from *GB *to *MB*, reverse the formula as follows (for row 2):

=A2 * 1024

**Using the CONVERT Function to Convert Bytes to MB or GB**

If you don’t want to go through the trouble of memorizing the conversion factors for storage size conversions, you can use the CONVERT function instead. This function lets you convert numbers in one measurement system or unit to another. So, you can use it to convert *Bytes *to *MB *or *GB *and vice-versa.

The syntax for the CONVERT function is:

=CONVERT (number,from_unit,to_unit)

Here,

*number*is the numeric value (or cell reference containing the value) that you want to convert.*from_unit*is the unit in which number is expressed.*to_unit*is the unit to which you want to convert the number.

So if you want to convert the contents of cell A2 from *Bytes *to *Kilobytes*, you would use the CONVERT function as follows:

=CONVERT(A2,”byte”,”kibyte”)

Note that there are fixed identifiers for the different units. You can use the following table to obtain the identifiers for your required storage units:

Unit | Identifier |

Byte | byte |

Kilobyte | kibyte |

Megabyte | Mibyte |

Gigabyte | Gibyte |

Terabyte | Tibyte |

Note that the CONVERT function is case-sensitive. So you need to make sure that the strings you use in the second and third arguments of the function are in the correct case.

If the function does not recognize a string, it will return a #N/A error.

It will also return an error if the units in the two parameters are not compatible.

**Converting Bytes to MB and Vice versa**

Let us say you have the following numbers in *Bytes *and want to convert all of them to *MB*:

To convert from *Bytes *to *MB*, use the following formula (for row 2):

=CONVERT(A2,"byte","Mibyte")

To convert from *MB *to *Bytes*, reverse the parameters as follows (for row 2):

=CONVERT(A2,”Mibyte”,”byte”)

**Converting Bytes to GB and Vice versa**

If you have the same numbers in *Bytes *and want to convert all of them to GB instead, use the following formula (for row 2):

=CONVERT(A2,"byte","Gibyte")

To convert from *GB *to *Bytes*, reverse the parameters as follows (for row 2):

=CONVERT(A2,"Gibyte","byte")

**Converting MB to GB and Vice versa**

Now consider the case where you have the following numbers in *MB *instead and want to convert all of them to *GB*:

In this case, you can use the following formula (for row 2):

=CONVERT(A2,"Mibyte","Gibyte")

To convert from *GB *to *MB*, reverse the parameters as follows (for row 2):

=CONVERT(A2,"Gibyte", "Mibyte")

In this tutorial we saw two ways of converting *Bytes *to *MB *or *GB *in Excel.

We also showed you how to convert *MB *and *GB *back to *Bytes *and how to convert between *MB *and *GB*.

The methods discussed in the tutorial can be extended to the other units of storage (like *TB*, *PB*) as well.

We hope the tutorial was helpful for you.

**Other articles you may also like:**