# MB vs MiB and GB vs GiB: File Size Units Explained

Understand why MB differs from MiB and GB from GiB, with exact byte counts, conversion formulas and storage-capacity examples.

By DevBricks Team
Published: 2026-11-28T03:39:00.000Z
Updated: 2026-11-17T03:39:55.550Z
Canonical: https://tools.devbrickstech.com/blog/mb-versus-mib-and-gb-versus-gib-file-size-units-explained

Have you ever bought a storage device labeled 500 GB and found that your computer shows a smaller number? Or downloaded a file that one program calls 100 MB while another calls about 95 MiB? Those numbers can both be correct. The confusion often comes from mixing **decimal storage units** with **binary storage units**.

**Quick answer:** `MB` means megabyte, or **1,000,000 bytes**. `MiB` means mebibyte, or **1,048,576 bytes**. Similarly, `GB` means 1,000,000,000 bytes and `GiB` means 1,073,741,824 bytes. To convert accurately, start from the number of bytes and divide by the correct unit size. The [DevBricks Data Size Converter](/tools/data-size-converter) can help check the arithmetic.

This guide explains the standards behind these units, shows exact conversion formulas, works through storage and download examples, and identifies mistakes that can affect capacity planning, data transfer estimates, and technical documentation.

## Decimal and binary units: the central difference

Decimal prefixes use powers of **1,000**. They follow the international SI naming convention: kilo means 10³, mega means 10⁶, giga means 10⁹, and tera means 10¹². When applied to bytes, those prefixes give KB, MB, GB, and TB.

Binary prefixes use powers of **1,024**, which is 2¹⁰. The IEC-created prefixes kibi, mebi, gibi, and tebi distinguish binary multiples from decimal ones. Their symbols are Ki, Mi, Gi, and Ti. Applied to bytes, the units become KiB, MiB, GiB, and TiB.

| Unit | Decimal or binary? | Bytes |
|---|---|---:|
| 1 KB | Decimal | 1,000 |
| 1 KiB | Binary | 1,024 |
| 1 MB | Decimal | 1,000,000 |
| 1 MiB | Binary | 1,048,576 |
| 1 GB | Decimal | 1,000,000,000 |
| 1 GiB | Binary | 1,073,741,824 |
| 1 TB | Decimal | 1,000,000,000,000 |
| 1 TiB | Binary | 1,099,511,627,776 |

The prefixes may look similar, but they represent different quantities. This is a standards issue, not a disagreement about whether computers fundamentally use binary digits.

## Why MB and MiB are not interchangeable

One mebibyte contains 1,048,576 bytes, while one megabyte contains 1,000,000 bytes. The difference is 48,576 bytes per unit, or roughly 4.86% relative to one megabyte.

So a file with 100,000,000 bytes has a size of:

- **100 MB** in decimal units.
- **About 95.37 MiB** in binary units.

Nothing about the file changed. Only the denominator used to express its size changed.

To verify:

```text
MB  = bytes / 1,000,000
MiB = bytes / 1,048,576
```

For 100,000,000 bytes:

```text
100,000,000 / 1,000,000 = 100 MB
100,000,000 / 1,048,576 ≈ 95.3674 MiB
```

Use the [DevBricks Data Size Converter](/tools/data-size-converter) to compare units while keeping the original byte count consistent.

## Why GB and GiB differ even more

A gigabyte is 1,000,000,000 bytes. A gibibyte is 1,073,741,824 bytes. The relative difference grows as prefixes increase because every binary step multiplies by 1,024 instead of 1,000.

For example, a drive labeled **500 GB** contains 500,000,000,000 bytes in the decimal capacity convention. In GiB, that is:

```text
500,000,000,000 / 1,073,741,824 ≈ 465.66 GiB
```

A device showing a value near 465.66 in a binary-based display does not mean that about 34 GB of storage has mysteriously disappeared. It means the displayed numeric value uses a different unit magnitude. Actual usable capacity may be smaller again after formatting, file-system structures, recovery partitions, and other system overhead.

Be careful when interpreting operating-system interfaces. Some systems and applications label binary-based quantities with the historical `GB` abbreviation, while others use explicit `GiB` notation. Inspect the documentation for the software you are using rather than assuming every label is standards-precise.

## The exact conversion formulas

When converting from bytes:

```text
KB  = bytes / 1,000
KiB = bytes / 1,024
MB  = bytes / 1,000,000
MiB = bytes / 1,048,576
GB  = bytes / 1,000,000,000
GiB = bytes / 1,073,741,824
```

When converting from one named unit into bytes, multiply instead of divide. For example:

```text
3 MiB = 3 × 1,048,576 = 3,145,728 bytes
3 MB  = 3 × 1,000,000 = 3,000,000 bytes
```

If you need to convert from MiB to MB directly:

```text
MB = MiB × 1,048,576 / 1,000,000
```

Therefore:

```text
50 MiB = 52.4288 MB
```

To convert from MB to MiB:

```text
MiB = MB × 1,000,000 / 1,048,576
```

Therefore:

```text
50 MB ≈ 47.6837 MiB
```

For calculations involving multiple systems, convert through the raw byte count to avoid rounding errors. Round only the final displayed result when possible.

## Worked example: comparing two file-size limits

Suppose a website accepts uploads up to **10 MB**, while a desktop program reports file sizes in MiB. A file is reported as 9.8 MiB by the desktop program. Is it under a 10 MB decimal limit?

Calculate its bytes:

```text
9.8 × 1,048,576 = 10,276,044.8 bytes
```

File sizes are whole bytes, so this is approximately 10,276,045 bytes. That equals about **10.276 MB**, which exceeds a strict 10,000,000-byte limit. The label “9.8” looked smaller than “10,” but the units differed.

A robust upload validator should enforce a byte threshold rather than comparing rounded display strings. If the service advertises 10 MB, the developer should clarify whether it means 10,000,000 bytes or another convention rather than leaving users to guess.

## Worked example: interpreting a 1 TB external drive

A decimal 1 TB capacity represents 1,000,000,000,000 bytes. Converting to binary TiB:

```text
1,000,000,000,000 / 1,099,511,627,776 ≈ 0.9095 TiB
```

This is why a nominal 1 TB drive may appear around 0.91 TiB in software that uses explicit binary units. Additional formatting and file-system overhead may reduce available capacity, but the decimal-to-binary difference explains the biggest apparent numerical gap.

If you compare drive listings from different manufacturers, use the same unit and definition of usable capacity. A vendor's decimal capacity and an operating system's binary display are not directly comparable numeric figures until converted.

## MB/s vs Mbps: don't confuse size with speed

The capital `B` represents bytes; lowercase `b` commonly represents bits. Because one byte contains eight bits, 1 MB/s and 1 Mbps are very different data rates.

A connection advertised at 80 Mbps has a theoretical decimal transfer capacity of:

```text
80 megabits / second ÷ 8 = 10 megabytes / second
```

That is **10 MB/s**, not 80 MB/s. Actual transfer speed may be lower because of network overhead, congestion, storage performance, or the remote server.

The [DevBricks Bandwidth Calculator](/tools/bandwidth-calculator) is useful for checking rates, but be sure you enter the correct units. File sizes and transfer rates require consistent bits-versus-bytes conventions when estimating download times.

## How operating systems and apps display storage

Historically, software interfaces have sometimes used the labels KB, MB, and GB for values derived from powers of 1,024, even though standards distinguish them from KiB, MiB, and GiB. This creates confusion when comparing a product package, a file manager, a command-line output, and a programming API.

For reliable calculations, ask the system for a raw byte count when available. In a codebase, name variables clearly—for example, `fileSizeBytes`, `limitBytes`, and `displayMiB`—rather than storing an unlabeled number such as `size=100`.

When writing user-facing documentation, use explicit units and, when helpful, show both forms. A message such as `Maximum upload: 10,000,000 bytes (10 MB, about 9.54 MiB)` is much less ambiguous than simply saying `10M`.

## Rounding without losing accuracy

If you convert a large file size repeatedly and round at each stage, small errors accumulate. For example, converting bytes to MiB rounded to one decimal place, then converting that rounded number back to bytes, will not always recover the original size.

Use integers for byte counts whenever possible. For display, two decimal places are often enough, but exact limits should be enforced using whole bytes. This is particularly important for storage quotas, API upload restrictions, database fields, and billing calculations.

Avoid making purchasing or infrastructure decisions based only on a rounded interface number. Check the exact unit convention and how the service charges for storage and transfer.

## Common MB/MiB conversion mistakes

**Dividing by 1,000 when the quantity is binary.** If a system provides bytes and asks for MiB, divide by 1,048,576.

**Comparing values without units.** A result of 500 GB is not numerically equivalent to 500 GiB.

**Using bits where bytes are expected.** `Mbps` and `MB/s` differ by a factor of eight before any network overhead.

**Assuming all software displays standards-correct labels.** Some programs use historical labels. Check documentation or raw bytes.

**Assuming the storage difference proves a defective drive.** Decimal versus binary presentation explains much of the apparent difference, although actual reserved capacity must be considered separately.

**Rounding too early.** Preserve exact byte values until the final calculation.

## Frequently asked questions

### Is 1 MB equal to 1024 KB?

Under decimal SI prefixes, **1 MB = 1000 KB**. Under binary prefixes, **1 MiB = 1024 KiB**. The confusion comes from older or informal software labeling conventions.

### Is 1 GB bigger or smaller than 1 GiB?

One GiB is larger: 1 GiB equals 1,073,741,824 bytes, while 1 GB equals 1,000,000,000 bytes.

### Why does a 500 GB drive show about 465 GiB?

Because 500 billion bytes divided by 1,073,741,824 bytes per GiB equals about 465.66 GiB. File-system overhead can further affect usable capacity.

### Which unit should developers use for upload limits?

Define and enforce the limit in bytes. Display a clear label and conversion for users. Do not compare rounded MB or MiB strings in application logic.

### Do MB and MiB describe different file contents?

No. They are different units expressing the same underlying byte count. Converting the unit does not modify the file.

## Conversion checklist

- [ ] I know whether the quantity is bytes or bits.
- [ ] I know whether the prefix is decimal or binary.
- [ ] I preserved the raw byte count where possible.
- [ ] I divided by the correct unit size.
- [ ] I did not compare rounded numbers with incompatible units.
- [ ] I checked software-specific display conventions.
- [ ] I documented units clearly for readers and users.

## Final takeaway

**MB and GB use decimal powers of 1,000; MiB and GiB use binary powers of 1,024.** The distinction explains many apparently inconsistent file and storage sizes. When accuracy matters, calculate from bytes, use the correct divisor, and keep bit rates separate from byte sizes.

Check a conversion with the [DevBricks Data Size Converter](/tools/data-size-converter), or estimate transfer rates using the [DevBricks Bandwidth Calculator](/tools/bandwidth-calculator).

## Worked example: estimating cloud storage use

Suppose a backup job reports 250 GiB of source data, while a cloud service advertises storage in decimal GB. Converting first to bytes gives:

```text
250 GiB × 1,073,741,824 bytes/GiB
= 268,435,456,000 bytes
```

Then divide by one billion to express the amount in decimal GB:

```text
268,435,456,000 / 1,000,000,000
= 268.435456 GB
```

So a source quantity of 250 GiB represents about 268.44 GB before any compression, deduplication, metadata, or billing-specific rules. The difference matters when forecasting a quota or cost. Do not estimate the bill from storage unit conversion alone: the provider may use its own measurement period, rounding rules, and billing categories.

For the reverse calculation, a 300 GB decimal allocation contains 300 billion bytes. Dividing by 1,073,741,824 gives approximately 279.40 GiB. A team planning how many datasets fit in that allocation should use the actual byte counts and allow space for operational overhead, rather than comparing “300” and “280” as if their units matched.

When documenting the result for colleagues, keep both values visible: **250 GiB ≈ 268.44 GB**. The unit suffix is part of the result, not optional decoration.

## Sources and further reading

- [NIST — Definitions of binary prefixes](https://pml.nist.gov/cuu/Units/binary.html)
- [NIST — SI prefixes and powers of ten](https://www.nist.gov/pml/special-publication-811/nist-guide-si-chapter-4-two-classes-si-units-and-si-prefixes)
- [BIPM — SI prefixes](https://www.bipm.org/en/measurement-units/si-prefixes/)
