File Size

Web & Dev

Convert between file size units

A photo labeled "4 MB" on your phone might show as "3.81 MB" on your computer and something slightly different again once it's uploaded to cloud storage. None of these numbers are wrong — they're using two different, competing definitions of what a megabyte is. Storage manufacturers and most cloud services use decimal units (1 MB = 1,000,000 bytes), while operating systems like Windows and macOS traditionally display binary units (1 MB = 1,048,576 bytes) using the same MB label.

This file size converter handles both conventions. Enter a value in bytes, KB, MB, GB, or TB, and get accurate conversions in both the decimal (1000-based) and binary (1024-based) systems, so you can match whatever number your operating system, cloud provider, or email client is showing you.

It's built for everyday practical questions: will this video fit under a 25 MB email attachment limit, how many photos fit in 15 GB of free cloud storage, or how much space will a 4K video actually take up compared to what the camera app estimated.

Why File Size Matters

File size conversions come up constantly in software and web development. Estimating asset budgets for a web page (keeping total page weight under a target for performance), configuring upload size limits on a server or API endpoint, calculating how much storage a user-generated content platform needs to provision, and understanding cloud storage billing (which is almost always metered in decimal GB, not binary GiB) all depend on getting these unit conversions right. A mismatch between the binary and decimal interpretation of "1 GB" introduces roughly a 7% error, which compounds into real budgeting mistakes at scale — provisioning storage for 10,000 users based on the wrong assumption can leave a system meaningfully under- or over-provisioned.

Outside of engineering, the same conversions answer everyday questions: is a photo too large for an email attachment (most providers cap attachments at 20–25 MB), will a phone's remaining storage fit a video recording session, or how many songs fit on a device with a given amount of free space. Photography and video professionals in particular deal with this daily — a single RAW photo can be 25–45 MB, and an hour of 4K video can approach 40–50 GB, so understanding exactly how storage units add up avoids running out of space mid-shoot.

The File Size Formula, Explained

Decimal: 1 KB = 1,000 bytes, 1 MB = 1,000 KB, 1 GB = 1,000 MB, 1 TB = 1,000 GB (each step is ×1000). Binary: 1 KiB = 1,024 bytes, 1 MiB = 1,024 KiB, 1 GiB = 1,024 MiB, 1 TiB = 1,024 GiB (each step is ×1024).

The core conversion is a base change: decimal units scale by powers of 1000 (consistent with the metric system — kilo, mega, giga, tera), while binary units scale by powers of 1024 (2^10), because computer memory and storage are naturally organized in powers of two. To formally distinguish them, the International Electrotechnical Commission (IEC) defined binary prefixes — KiB, MiB, GiB, TiB — though in practice, operating systems and everyday usage frequently still label binary values as KB, MB, and GB.

To convert bytes to any decimal unit: divide by 1000 raised to the power of the unit's position (KB = ÷1000¹, MB = ÷1000², GB = ÷1000³, TB = ÷1000⁴). For binary units, replace 1000 with 1024 in the same formula.

The practical effect: a 1 GB (decimal) file reported by a storage vendor equals 0.9313 GiB (binary) as shown by many operating systems — which is why a "500 GB" hard drive often shows roughly "465 GB" of usable space in the OS.

How to Use the File Size: Step by Step

  1. Enter the file size value

    Input the numeric size of your file or storage amount.

  2. Select the source unit

    Choose the unit you're starting from: bytes, KB, MB, GB, or TB.

  3. Choose binary or decimal (or view both)

    Select whether the source value uses the 1000-based (decimal, common for storage marketing and cloud billing) or 1024-based (binary, common in OS file managers) convention. The calculator can also show both side by side.

  4. Read the converted results

    View the equivalent value in every other unit, with binary and decimal results labeled separately to avoid confusion.

File Size Examples: Real-World Scenarios

1

Will a Video Fit Under an Email Attachment Limit?

Jordan has a 22 MB video file and needs to know if it fits under Gmail's 25 MB attachment limit, and how large it is in KB for a legacy upload form that only accepts KB values.

File size:22 MB
Convert to:KB (both binary and decimal)

Calculation

Decimal: 22 × 1,000 = 22,000 KB. Binary: 22 × 1,024 = 22,528 KB.

Result

22 MB fits comfortably under the 25 MB limit either way. In KB, the value is 22,000 KB (decimal) or 22,528 KB (binary) — a 528 KB difference depending on which system the upload form expects.

2

How Many Photos Fit in Free Cloud Storage?

A photographer has 15 GB of free cloud storage (decimal, as billed by the provider) and wants to know the equivalent in binary GiB, since their photo app reports file sizes in GiB-based MB.

Storage:15 GB (decimal)
Convert to:GiB (binary)

Calculation

15 GB × 1,000,000,000 bytes = 15,000,000,000 bytes. Divide by 1,073,741,824 (1024³) = 13.97 GiB.

Result

15 GB of cloud storage (as billed) equals about 13.97 GiB as shown by an operating system — roughly 7% less than the number on the storage plan.

3

Converting a RAW Photo Library to GB

A photographer shot 480 RAW photos averaging 35 MB each and wants the total size in GB to plan a memory card purchase.

Photo count:480
Average size:35 MB each

Calculation

480 × 35 MB = 16,800 MB. Decimal: 16,800 / 1,000 = 16.8 GB. Binary: 16,800 / 1,024 = 16.41 GiB.

Result

The library needs about 16.8 GB (decimal) of storage — a 32 GB card provides comfortable headroom under either unit convention.

Common Mistakes to Avoid

  • Assuming 1 GB always equals 1,024 MB. Storage vendors, cloud providers, and network speeds almost universally use the decimal definition (1 GB = 1,000 MB), while some operating systems still label binary values (1,024 MB) with the same "GB" unit — this is why a new drive's capacity always looks smaller once formatted.
  • Forgetting that email and upload size limits are typically stated in decimal MB, so binary-calculated file sizes can appear to fit when the true decimal size is slightly larger, or vice versa.
  • Confusing megabits and megabytes when checking upload limits — an API documented as accepting a "50 Mb" payload means 50 megabits (6.25 MB), not 50 megabytes, an 8× difference.

Tips & Tricks

  • When in doubt about which convention a tool uses, check whether a "1 TB" drive shows as 1,000 GB or 931 GiB in your OS — that tells you which system it's reporting in.
  • For storage planning, always use the decimal (1000-based) figures that match how cloud providers and manufacturers advertise and bill for capacity, then subtract 5–10% as a buffer for the binary display discrepancy.

File size conversion looks trivial until the 1000-versus-1024 ambiguity causes a real mismatch between what a vendor advertises and what an operating system displays. Use this converter whenever you need to reconcile the two, plan storage budgets, or check attachment and upload limits. Pair it with the download time calculator to estimate transfer times and the bandwidth calculator for network capacity planning.

File Size — Frequently Asked Questions

Related Calculators

Authoritative References

External links open in a new tab. OmniCalc.us is not affiliated with these organisations.

Related Calculators