Blog · Utilities

How to Calculate File Size and Upload Limits

Calculate file sizes in bytes, KB, MB, and GB — and check whether your files are within upload limits for email attachments, web forms, or cloud storage.

Share
On this page

File sizes and upload limits cause more friction than they should. You finish a piece of work, try to send it, and get an error about a limit you did not know existed. Understanding how file sizes are calculated — and how to estimate or reduce them — means fewer surprises and less time spent re-exporting and re-uploading.

Bits, Bytes, and Why the Difference Matters

The fundamental unit of digital storage is the bit, which holds a single binary value: 0 or 1. Eight bits make one byte. Every file on your computer is measured in bytes.

The confusion comes from the fact that internet speeds are reported in bits per second while file sizes are reported in bytes. A broadband connection advertised as 100 Mbps (megabits per second) delivers approximately 12.5 MB (megabytes) of file data per second — not 100 MB. ISPs use bits because the numbers look larger and more impressive. File systems use bytes because it is the natural unit for data storage.

When you are calculating how long a download will take or how much data you are transferring, always confirm whether the number you are looking at is bits or bytes before doing any math.

The Full Size Chain: From Bytes to Terabytes

Storage units follow a consistent progression. The binary standard used by operating systems defines each step as a multiple of 1,024:

Unit Abbreviation Exact Size
Byte B 8 bits
Kilobyte KB 1,024 bytes
Megabyte MB 1,024 KB = 1,048,576 bytes
Gigabyte GB 1,024 MB = 1,073,741,824 bytes
Terabyte TB 1,024 GB = 1,099,511,627,776 bytes

Drive manufacturers use a different convention — they define 1 KB as 1,000 bytes (not 1,024), which makes their capacity numbers look larger on the box. A drive sold as 500 GB will show approximately 465 GB in Windows or macOS because the operating system uses binary prefixes. This is not missing storage — it is a genuine difference in how the units are defined.

Common Upload Limits by Platform

Knowing the limits before you try to upload saves a round trip. Here are the actual limits for the most frequently used platforms:

  • Gmail: 25 MB per message, including all attachments combined
  • Outlook / Hotmail: 20 MB per email
  • WhatsApp: 100 MB for documents, 16 MB for images, 64 MB for video
  • Google Drive (upload): 5 TB per file, but Docs/Sheets/Slides have lower conversion limits
  • Dropbox: 50 MB on the web uploader, no limit via desktop client
  • WordPress media library: Default is 2 MB per file, often raised by the hosting provider to 10–64 MB
  • Web forms (general): Commonly 2–10 MB, but it varies by developer configuration
  • Slack: 1 GB per file on paid plans, 5 MB on free plans

If a platform does not publish its limit, a practical starting point is to aim for files under 5 MB for email, under 10 MB for web forms, and under 20 MB for messaging apps.

Estimating Image File Size Before Exporting

Before you export an image, you can estimate its uncompressed size using this formula:

Uncompressed size (bytes) = width (pixels) x height (pixels) x (bit depth / 8)

A common bit depth for color images is 24 bits (8 bits per channel for red, green, and blue). So a 3,000 x 2,000 pixel photograph at 24-bit color has an uncompressed size of:

3,000 x 2,000 x 3 = 18,000,000 bytes = approximately 17.2 MB

That is the raw uncompressed size. The actual exported file will be much smaller once compression is applied.

A JPEG exported at 80% quality might compress that same image down to 2–4 MB. A PNG of the same image would be losslessly compressed to around 10–14 MB. A WebP file, which uses more efficient modern compression, might land at 1.5–3 MB. The compression ratio varies depending on image content — photos with lots of natural variation compress differently than flat graphics.

How Compression Works and Why It Changes Everything

Compression algorithms find and eliminate redundancy in file data. In an image with a large area of uniform blue sky, a compression algorithm does not need to store the same blue value thousands of times — it can record "blue, repeated 4,000 times" instead. Images with more visual complexity compress less efficiently.

There are two types of compression to understand:

Lossless compression removes redundancy without discarding any data. The decompressed file is bit-for-bit identical to the original. PNG and ZIP use lossless compression. The size reduction is real but limited.

Lossy compression goes further by discarding data that the human eye is unlikely to notice — usually fine detail in gradients and shadows. JPEG uses lossy compression. The size reduction can be dramatic (5x to 10x compared to PNG), but image quality degrades slightly with each compression step. Saving a JPEG as a JPEG multiple times compounds the quality loss.

Practical Tips for Reducing File Size Before Uploading

If a file is too large to upload, these approaches reduce size without losing the content that matters.

For images, resize the image to the actual display dimensions first. A photograph shot at 6,000 x 4,000 pixels does not need to be that large for a web form or an email. Resize it to 1,200 x 800 before compressing. The Image Compressor at FixTools handles this quickly and strips embedded metadata like GPS coordinates and camera settings, which can add hundreds of kilobytes to a file without affecting the visible image.

For PDFs, the main culprit is usually embedded images. A report with several high-resolution screenshots can run to 30–50 MB. The PDF Compressor downsamples embedded images and re-encodes them at lower resolution, typically reducing a 30 MB PDF to 3–5 MB while keeping text and charts perfectly readable.

For video files, reducing the resolution (from 4K to 1080p, or from 1080p to 720p) has the largest impact on size. Dropping from 4K to 1080p typically reduces file size by around 75%.

Filesystem Overhead: Why You Cannot Fill a Drive Completely

One last wrinkle: a drive's usable capacity is always somewhat less than its nominal size, even beyond the unit-definition difference mentioned earlier. Filesystems reserve space for their own structures — the directory index, metadata tables, and recovery sectors. On a typical 1 TB drive formatted with NTFS or APFS, you will lose another 1–3 GB to filesystem overhead before you store a single file. Leaving at least 10–15% of a drive free is also good practice to maintain write performance and avoid fragmentation.

Understanding these numbers takes the guesswork out of managing storage and sending files — you know what you are working with before the error message appears.

Try it instantly

Use these free FixTools right in your browser. No sign-up, no uploads—your data stays private.

Frequently asked questions

  • Why does my 1 TB hard drive show less than 1 TB of usable space?

    Drive manufacturers define 1 TB as 1,000,000,000,000 bytes (using decimal prefixes), but operating systems measure storage using binary prefixes where 1 TB equals 1,099,511,627,776 bytes. A 1 TB drive therefore shows approximately 931 GB in Windows or macOS. This is not missing space — it is a unit definition mismatch.

  • What is the difference between a bit and a byte?

    A bit is the smallest unit of digital data and can hold either a 0 or a 1. A byte is 8 bits. File sizes are measured in bytes (KB, MB, GB), while internet speeds are measured in bits per second (Mbps, Gbps). This is why a 100 Mbps connection downloads at about 12.5 MB per second, not 100 MB per second.

  • How do I reduce a file size before uploading it?

    The most effective approach depends on the file type. For images, export at a lower quality setting or use a dedicated compressor to strip metadata and optimize encoding. For PDFs, re-export at a lower resolution or use a PDF compressor to downsample embedded images. For video, reduce the resolution or bitrate using a tool like HandBrake.

  • Why are JPEG files smaller than PNG files of the same image?

    JPEG uses lossy compression, which discards some image data to achieve smaller file sizes. PNG uses lossless compression, which preserves every pixel exactly. For photographs, JPEG typically achieves 5 to 10 times smaller file sizes with acceptable quality loss. PNG is better suited to graphics, screenshots, and images with text where sharpness matters.

  • What upload limit should I plan for when submitting files to websites?

    Most web forms set limits between 2 MB and 10 MB. Email attachments cap at 25 MB for services like Gmail. WhatsApp allows up to 100 MB for documents and 16 MB for images. Cloud storage services like Google Drive and Dropbox accept individual files up to 5 GB. Always check the specific platform's documentation, as limits vary significantly.

O. Kimani

Software Developer & Founder, FixTools

Building FixTools — a single destination for free, browser-based productivity tools. Every tool runs client-side: your files never leave your device.

About the author →

Related articles