File Size Calculator: How to Convert KB, MB, GB
- Value
- 500
- You entered
- From unit
- B
- You entered
- To unit
- B
- You entered
A file size calculator converts between digital storage units—bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), and beyond—so you can quickly know how much space a file occupies or how long a transfer will take. You enter a number and choose the starting unit (like MB) and the target unit (like GB), and the calculator returns the converted value using the standard binary (1,024) or decimal (1,000) multipliers. This article explains the formulas, why the two systems exist, and how to avoid the unit mix-ups that cause most conversion errors.
Formula
The core formula is a simple ratio:
Converted value = (input value × multiplier of the “from� unit) ÷ multiplier of the “to� unit
where each unit’s multiplier is its size in bytes:
- 1 byte = 1
- 1 KB = 1,024 bytes (binary) or 1,000 bytes (decimal)
- 1 MB = 1,048,576 bytes (binary) or 1,000,000 bytes (decimal)
- 1 GB = 1,073,741,824 bytes (binary) or 1,000,000,000 bytes (decimal)
- 1 TB = 1,099,511,627,776 bytes (binary) or 1,000,000,000,000 bytes (decimal)
The calculator above uses the binary system (1,024-based), which is what most operating systems (Windows, macOS, Linux) use when displaying file sizes. For example, a file that is 5,242,880 bytes shows as “5.0 MB� in Windows because 5,242,880 ÷ 1,048,576 = 5.0.
Worked Example
Using the default values: input = 500, from = MB, to = GB.
- Convert the input to bytes: 500 MB × 1,048,576 bytes/MB = 524,288,000 bytes.
- Convert bytes to the target unit: 524,288,000 bytes ÷ 1,073,741,824 bytes/GB ≈ 0.4883 GB.
- Rounded to two decimals: 0.49 GB.
So 500 MB is about 0.49 GB (binary). If you used decimal units, it would be 0.50 GB exactly. That small difference is why conversions can seem “off� between devices.
Why Are There Two Different Systems?
The confusion stems from two conventions:
- Binary (IEC): Uses 1,024 as the multiplier because computers address memory in powers of two. Units are often written KiB, MiB, GiB, but many operating systems still label them KB, MB, GB.
- Decimal (SI): Uses 1,000 as the multiplier, following the International System of Units. Hard drive manufacturers and network speeds typically use this system, so a “500 GB� drive actually holds 500,000,000,000 bytes, which Windows reports as about 465 GB.
This discrepancy is why a new hard drive seems smaller than advertised. It’s not a defect—it’s a unit mismatch.
When to Use a File Size Calculator
You’ll most often need one when:
- Checking if a file fits on a USB stick, SD card, or cloud storage plan with a specific free quota.
- Comparing file size limits for email attachments (e.g., a 25 MB limit) when your file is shown in KB or GB.
- Estimating download time: if your connection speed is 10 MB/s (megabytes per second) and a file is 2 GB, it will take roughly 200 seconds.
- Converting between decimal and binary units when dealing with video bitrates, memory, or disk partitions.
For quick mental math, remember: 1 MB ≈ 0.001 GB (decimal) or 0.0009766 GB (binary). Most people round to 1,000 for speed estimates, but use 1,024 when exact storage counts matter.
Common Mistakes and How to Avoid Them
The most frequent error is mixing up the two systems. If you convert 1 GB to MB using decimal you get 1,000 MB, but using binary you get 1,024 MB. Another common mistake is confusing bits (b) with bytes (B). A bit is one-eighth of a byte. Internet speeds are usually quoted in megabits per second (Mbps), while file sizes are in megabytes (MB). A 100 Mbps connection downloads at about 12.5 MB/s, not 100 MB/s.
Rounding too early can also cause errors. If you round intermediate results, the final number can be off by several percent. Always keep at least three significant digits until the final step.
Limits of the Formula
This calculator assumes the binary system, which is standard for file storage in most operating systems. However, some contexts (like network speeds, hard drive marketing, and certain software) use decimal. If you need decimal, simply change the multipliers to 1,000, 1,000,000, etc. The formula itself is universal—only the multipliers change.
Also note that file systems have overhead. A 4 KB file on a disk with 4 KB clusters actually takes 4 KB of space, not the exact file size. This overhead is not accounted for by a simple size converter.
Frequently Asked Questions
How many KB are in a MB?
In binary, 1 MB = 1,024 KB. In decimal, 1 MB = 1,000 KB. Most file managers use binary, so you’ll see 1,024.
Why does my 1 TB drive show only 931 GB in Windows?
Because the drive manufacturer uses decimal (1 TB = 1,000,000,000,000 bytes), while Windows uses binary (1 GB = 1,073,741,824 bytes). Divide 1,000,000,000,000 by 1,073,741,824 and you get about 931.3 GB.
Is a 1 GB file the same as 1000 MB or 1024 MB?
It depends on the context. For storage capacity, most OSes use 1,024 MB. For network transfer rates or when a vendor specifies decimal, it’s 1,000 MB. Always check which system the source uses.
What’s the difference between a bit and a byte?
A bit is the smallest unit of data (0 or 1). A byte is 8 bits. File sizes are measured in bytes, while network speeds are often in bits per second. To convert Mbps to MB/s, divide by 8.
How do I convert file size to download time?
Divide the file size (in bits) by the connection speed (in bits per second). For example, a 1 GB file (8,589,934,592 bits) at 100 Mbps (100,000,000 bits/s) takes about 86 seconds. Use the calculator to convert units first.
Should I use KiB or KB?
KiB (kibibyte) is the unambiguous binary unit (1,024 bytes), while KB can mean either 1,000 or 1,024. To avoid confusion, use KiB when you mean binary, and KB when you mean decimal. Most consumer software still uses KB/MB/GB with binary meaning.
Related
Formula used
in num | Value | - | 500 | 0 sel from | From unit | B=1, KB=1024, MB=1048576, GB=1073741824, TB=1099511627776 sel to | To unit | B=1, KB=1024, MB=1048576, GB=1073741824, TB=1099511627776 out result | Converted value | - | num * from / to | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.