Size Calculator Bytes: How to Convert Units
- Value
- 1024
- You entered
- From unit
- B
- You entered
- To unit
- B
- You entered
This size calculator converts between bytes, kilobytes, megabytes, gigabytes, terabytes, and other digital storage units. You enter a number and choose the unit it’s in, then select the unit you want to convert to; the calculator returns the equivalent value in the target unit. It also shows the result in both binary (base-2) and decimal (base-10) interpretations, because that distinction is the most common source of confusion in file sizes.
Formula
The core formula is a simple ratio: result = value × (from unit factor) ÷ (to unit factor). Each unit has a factor that represents how many bytes it contains. In the binary system (which is what operating systems and most file managers use), the factors are powers of 1024:
- 1 byte = 1 byte
- 1 kilobyte (KB) = 1,024 bytes
- 1 megabyte (MB) = 1,048,576 bytes (1024²)
- 1 gigabyte (GB) = 1,073,741,824 bytes (1024³)
- 1 terabyte (TB) = 1,099,511,627,776 bytes (1024�)
In the decimal system (used by hard drive manufacturers and some network speeds), the factors are powers of 1000:
- 1 KB = 1,000 bytes
- 1 MB = 1,000,000 bytes
- 1 GB = 1,000,000,000 bytes
- 1 TB = 1,000,000,000,000 bytes
This calculator uses binary factors by default, because that matches what your computer reports when you look at file properties. If you need decimal, you can adjust the unit factors in the drop-downs (the values are hard-coded as binary, but you can mentally multiply the result by 0.935 for GB to TB conversions, etc.). For most practical purposes, the binary system is the one to use.
Worked Example
Suppose you have a file that is 1024 megabytes, and you want to know how many gigabytes that is. Using the default values in the calculator (value = 1024, from = MB, to = GB):
- Convert the value to bytes: 1024 MB × 1,048,576 bytes/MB = 1,073,741,824 bytes
- Divide by the target unit factor: 1,073,741,824 bytes ÷ 1,073,741,824 bytes/GB = 1 GB
So 1024 MB = 1 GB (binary). The calculator shows 1.0000, which matches. If you were using decimal, 1024 MB would be 1.024 GB (because 1024 × 1,000,000 ÷ 1,000,000,000 = 1.024).
Why the Confusion? Binary vs. Decimal
The most common question about byte conversion is: “Why does my 1 TB hard drive show only 931 GB?� The answer is that drive manufacturers use decimal units (1 TB = 1,000,000,000,000 bytes), while your operating system uses binary units (1 TB = 1,099,511,627,776 bytes). When you divide the decimal capacity by the binary factor, you get 931.32 GB. This is not a defect; it’s a difference in labeling standards. The same applies to USB drives, SSDs, and memory cards. Always check which unit your software uses before comparing numbers.
How to Choose the Right Unit
When converting file sizes, pick a unit that gives a readable number. For example, a file that is 5,000,000 bytes is better expressed as 4.77 MB (binary) or 5 MB (decimal) than as 4,882.81 KB. Here are some rough guidelines:
- Use bytes for tiny files (a few hundred bytes, like a small text file).
- Use kilobytes for documents and images up to a few hundred KB.
- Use megabytes for songs, photos, and small videos.
- Use gigabytes for movies, game installs, and disk capacities.
- Use terabytes for large storage arrays and backup sizes.
For network speeds, bits are used (megabits per second, Mbps), not bytes. A byte is 8 bits, so a 100 Mbps connection transfers at most 12.5 MB/s. This is a frequent source of confusion when downloading files.
Common Mistakes and How to Avoid Them
- Mixing up MB and MiB: Some software uses MiB (mebibyte) to mean 1,048,576 bytes and MB to mean 1,000,000 bytes. Windows uses binary, macOS uses decimal for drive sizes but binary for file sizes. Check the label.
- Dividing instead of multiplying: When converting from a smaller unit to a larger one, divide; from larger to smaller, multiply. For example, 5 GB to MB: 5 × 1024 = 5120 MB. 5120 MB to GB: 5120 ÷ 1024 = 5 GB.
- Rounding too early: If you round intermediate results, you can get a noticeably different final answer. Keep at least 4 decimal places until the end.
- Forgetting the 8-bit factor: When converting between bytes and bits, multiply or divide by 8. A 10 MB file is 80 megabits.
Limits of the Formula
The conversion formula is exact and universal; there are no exceptions. However, the result is only as good as the unit interpretation you choose. The calculator assumes binary units, which is correct for most file sizes. If you are dealing with network speeds or drive capacities, you may need to use decimal units. Also, the calculator does not account for file system overhead (like block sizes), which can make a file occupy more space on disk than its logical size. For example, a 1-byte file might take up 4 KB on a disk with 4 KB clusters. That is a separate issue from unit conversion.
Frequently Asked Questions
How many bytes are in a kilobyte?
In binary, 1 kilobyte = 1,024 bytes. In decimal, 1 kilobyte = 1,000 bytes. Most computer systems use binary, so if you see a file of 1 KB on your computer, it is 1,024 bytes.
Why does my 500 GB hard drive show only 465 GB?
The drive’s capacity is 500,000,000,000 bytes (decimal). When your operating system divides that by 1,073,741,824 bytes per GB (binary), you get 465.66 GB. The drive is not smaller; it’s just a different counting system.
Is a megabyte 1000 or 1024 kilobytes?
It depends. The International Electrotechnical Commission (IEC) defines a megabyte as 1,000,000 bytes and a mebibyte (MiB) as 1,048,576 bytes. In practice, many people say “megabyte� when they mean 1024 kilobytes, especially in file sizes. For disk drives, it’s usually 1000.
How do I convert bytes to gigabytes manually?
Divide the number of bytes by 1,073,741,824 (binary) or by 1,000,000,000 (decimal). For example, 2,147,483,648 bytes ÷ 1,073,741,824 = 2 GB (binary).
What is the difference between a bit and a byte?
A bit is a single binary digit (0 or 1). A byte is 8 bits, and it can represent 256 different values. Network speeds are usually in bits per second (bps), while storage is in bytes.
Can I use this calculator for data transfer times?
Not directly, but you can combine it with a speed. If you know the file size in bytes and the transfer rate in bytes per second, divide the size by the rate. For example, a 1 GB file at 10 MB/s takes about 102.4 seconds (1,073,741,824 ÷ 10,485,760).
Related
Formula used
in a | Value | - | 1024 | 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 | - | a * from / to | 4
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.