Convert data sizes between bits, bytes, KB, MB, GB, TB, KiB, MiB, and GiB, or calculate total storage from a file count and average file size.
Data Size Formula
The calculator has two modes: convert one data size, or calculate total data for a file count and average file size.
Total files mode: Total bytes = number of files × average bytes per file.
Convert mode: Output = value × bytes per input unit ÷ bytes per output unit.
Decimal units (KB, MB, GB, TB, PB) use powers of 1000. IEC binary units (KiB, MiB, GiB, TiB, PiB) use powers of 1024. One byte equals 8 bits. Changing an input unit converts its current quantity.
File totals are logical data sizes. Filesystem allocation, metadata, compression and reserved space can change actual disk use. This calculator does not provide text-encoding or files-that-fit modes.
Reference Tables
Use the exact unit table to check conversions. The file-size ranges below are illustrative assumptions, not reliable limits; actual files depend on encoding, compression, duration and content.
| Unit | Bytes | Family |
|---|---|---|
| KB | 1,000 | Decimal |
| KiB | 1,024 | Binary |
| MB | 1,000,000 | Decimal |
| MiB | 1,048,576 | Binary |
| GB | 1,000,000,000 | Decimal |
| GiB | 1,073,741,824 | Binary |
| TB | 1,000,000,000,000 | Decimal |
| TiB | 1,099,511,627,776 | Binary |
| File type | Illustrative size (varies) |
|---|---|
| Plain text page | 2 to 10 KB |
| JPEG photo (phone) | 2 to 6 MB |
| RAW photo | 20 to 50 MB |
| MP3 song (3 min) | 3 to 5 MB |
| 1080p video (1 min) | 100 to 200 MB |
| 4K video (1 min) | 300 to 600 MB |
| PDF document | 100 KB to 5 MB |
| PC game install | 5 to 150 GB |
Examples and FAQ
Example 1: Total size from files. You have 1,500 photos at an average of 4 MB. Total = 1,500 × 4 MB = 6,000 MB, or 6 GB.
Additional manual example: files that fit. A 64 GB card holds files that average 250 MB. Fit = floor(64,000 MB / 250 MB) = 256 files before filesystem overhead. This is a manual capacity example, not a calculator mode.
Why does my 1 TB drive show as 931 GB? Drive makers label capacity in decimal TB (1,000,000,000,000 bytes). Operating systems often display the same bytes in binary GiB but call it “GB,” so 1 TB shows as about 931 GiB.
What is the difference between bits and bytes? One byte equals 8 bits. Network speeds are usually quoted in bits per second (Mbps), while file sizes are quoted in bytes (MB). Divide a bit rate by 8 to get the byte rate.
Why does the same text give different byte counts? Encoding decides how many bytes each character takes. The letter “A” is 1 byte in UTF-8 and 2 bytes in UTF-16. An emoji can be 4 bytes in UTF-8 and 4 bytes in UTF-16.
Should I plan storage with decimal or binary units? Match the source. Check the stated unit rather than assuming a device or operating-system convention. The gap depends on the prefix: 1 MB is about 0.954 MiB, 1 GB about 0.931 GiB, and 1 TB about 0.909 TiB.
