🗜️ Compression Ratio Calculator

Calculate compression ratio and space saved between an original and compressed file size, in either direction, and sanity-check your result against typical real-world ratios for ZIP, video, images, and audio.

🗜️ Size Comparison
Enter either direction — original and compressed size — the calculator works both ways.
📈 Compression Result
Compression Ratio
Space Saved
Space Saved (Amount)
Original Size
Compressed Size
Typical Real-World Compression Ratios
TypeTypical RatioSpace Saved
Original vs Compressed Size
⚠️ Reference ratios are typical industry figures and vary with content type, encoder settings, and file structure — treat them as a sanity check, not a guarantee.
📊

Enter your details and click Calculate to see results

Guide

About the Compression Ratio Calculator

Last updated: August 2026 · Reviewed by the NeftCal editorial team

Compression ratio is the standard way to express how much a compression algorithm shrank a file, and this compression ratio calculator computes it directly from an original and a compressed file size — whichever two numbers you have, in either direction. It's useful whether you're comparing archive tools, evaluating a new video codec, checking whether a backup job is actually compressing your data, or just curious how much smaller a ZIP or gzip made a folder of files.

What This Calculator Estimates

It converts your original and compressed sizes to a common unit and computes compression ratio = original ÷ compressed, expressed as X:1, along with space saved as both a percentage and an absolute amount.

Who Should Use This Calculator

Backend engineers evaluating a backup or logging compression strategy, developers comparing archive tools or video codecs, DBAs checking whether a database dump compresses as expected, and anyone curious how much smaller a ZIP or gzip made their files need this original-vs-compressed comparison.

Why Compression Ratio Matters

A compression ratio in isolation doesn't tell you much without context — 2:1 is excellent for already-compressed video but disappointing for plain text, which typically compresses 3:1 or better with gzip. Comparing your actual result against typical real-world ratios helps you judge whether an encoder setting, backup tool, or storage format is performing as expected, or whether something (like re-compressing already-compressed data) is limiting your results.

Real-World Applications

  • Checking whether a backup job's actual compression ratio is reasonable
  • Comparing zip vs gzip vs brotli for a specific data type
  • Evaluating a new video codec's bitrate savings at the same quality
  • Sizing database backup storage using an expected compression ratio
  • Pairing with the File Size Calculator to estimate a file's size before compression

Tips for Accurate Results

  • Compression ratio depends heavily on data type — text and structured data compress far better than already-compressed formats like JPEG, MP4, or MP3
  • If your ratio is close to 1:1 on a media file, that's often expected — the codec has already removed most redundancy
  • When comparing codecs (like H.264 vs H.265), make sure both files represent the same visual/audio quality
  • Use consistent units for original and compressed size, or let the unit selectors do the conversion for you
  • Remember that space saved percentage and compression ratio describe the same relationship differently — a 4:1 ratio always equals 75% space saved
Formula

The Compression Ratio Formula, Explained

How this calculator turns two file sizes into a ratio and percentage

Compression Ratio
Ratio = Original Size ÷ Compressed Size (expressed as X:1)

Space Saved
Space Saved (%) = (1 − Compressed Size ÷ Original Size) × 100

Space Saved (Amount) = Original Size − Compressed Size

Ratio and percentage always correspond exactly: a 4:1 ratio is always 75% saved, a 10:1 ratio is always 90% saved — they're two ways of expressing the same relationship.

📦

General-Purpose Compression

ZIP and similar archivers achieve roughly 2:1 on typical mixed files. Gzip on plain text can do better, often 3:1 or higher.

🎞️

Media Compression

Video, image, and audio codecs use specialized, lossy techniques. H.265 roughly halves H.264's bitrate (~2:1), JPEG can be 5-10× smaller than PNG for photos.

📊

Ratio vs Percentage

A compression ratio of 4:1 means the original is four times the compressed size — equivalent to 75% space saved.

⚙️ Why This Formula Works

Dividing original by compressed size normalizes the comparison regardless of the absolute file size, so a 4:1 ratio means the same thing whether it's a 4KB text file or a 4TB backup — making ratios directly comparable across very different scales.

🎯 When to Use It

  • Comparing compression tools or settings on the same data
  • Checking whether a backup or archival job is compressing as expected
  • Sanity-checking a codec's claimed savings against real file sizes

📋 Assumptions

  • Both sizes represent the same underlying data (not a different quality/content)
  • Sizes are entered in consistent, correctly-selected units
  • The comparison is size-only — it doesn't evaluate compression speed or fidelity

⚠️ Limitations of the Formula

  • Doesn't measure compression or decompression speed
  • Doesn't assess lossy compression's quality/fidelity tradeoff
  • A ratio near or below 1:1 can happen on tiny or already-compressed files due to format overhead
  • Reference ratios are typical figures, not guarantees for your specific file
Walkthrough

Step-by-Step: How to Use the Compression Ratio Calculator

From entering two sizes to reading your ratio and space saved

Enter your original size

Type the uncompressed (original) file or folder size into the Original Size field.

Choose the original size unit

Select KB, MB, or GB so the value matches how your file manager or backup tool reports it.

Enter your compressed size

Type the size of the file after compression (e.g., the resulting .zip, .gz, or encoded output).

Choose the compressed size unit

Select the matching unit — the calculator converts both sizes to a common unit automatically.

Click Calculate Ratio

See the compression ratio, percentage and absolute space saved, and how your result compares to typical real-world ratios.

Example

Worked Example

Using the calculator's own default scenario — 500 MB original, 125 MB compressed

Scenario

Suppose your original file is 500 MB and the compressed version is 125 MB.

Original500 MB
Compressed125 MB
Common UnitKB
Step 1 — Convert to KB: 500 × 1,024 = 512,000 KB original; 125 × 1,024 = 128,000 KB compressed.
Step 2 — Compression ratio: 512,000 ÷ 128,000 = 4.00:1.
Step 3 — Space saved percentage: (1 − 128,000 ÷ 512,000) × 100 = 75.0%.
Step 4 — Space saved amount: 512,000 − 128,000 = 384,000 KB = 375 MB.
Ratio
4.00:1
Space Saved
75.0%
Amount Saved
375 MB

Explanation: A 4:1 ratio (75% space saved) is a strong result, typical of text-heavy or structured data compressed with gzip or ZIP at a good compression level. If this were a video or JPEG file instead, a 4:1 ratio would be unusually high — media files already compressed with a specialized codec typically see ratios much closer to 1:1 under general-purpose compression.

Interpretation

Understanding Your Compression Ratio Result

What your ratio generally implies about the data and algorithm

RatioWhat It Generally MeansRecommended Next Step
Under 1.1:1Little to no compressible redundancyLikely already-compressed or encrypted data — expected, not a problem
1.1:1 – 2:1Modest compression, typical of mixed/media filesNormal for images, video, and general binary data
2:1 – 5:1Solid compression, typical of structured/text dataExpected range for logs, JSON, CSV, and general ZIP archives
Over 5:1Excellent compression, highly repetitive dataCommon for verbose logs or SQL dumps; verify data integrity after decompression

If your ratio is much lower than expected: check whether the source data is already compressed or encrypted, or whether your tool's compression level is set to "fastest" rather than "maximum."

If your ratio is unexpectedly high: that's usually good news for repetitive text data, but double-check the decompressed output matches the original if using a lossless format.

Reference ratios are typical industry figures — actual results vary with content type, encoder settings, and file structure.

ℹ️

This calculator compares file sizes only. It does not evaluate compression speed, CPU cost, or — for lossy formats — perceptual quality loss.

Use Cases

Practical Use Cases for the Compression Ratio Calculator

Where comparing original vs compressed size genuinely helps

💾

Backup storage optimization

Check whether a backup job's compression ratio is reasonable for the data type.

📝

Choosing a log compression algorithm

Compare gzip vs zstd vs brotli ratios on application log samples.

🆚

Comparing zip vs gzip vs brotli

Run the same file through multiple tools and compare resulting ratios.

🗄️

Database backup sizing

Estimate compressed backup storage needs from an expected compression ratio.

🎞️

Video codec evaluation

Compare H.264 vs H.265 file sizes at matching quality settings.

🖼️

Image format comparison

Compare JPEG vs PNG vs WebP compression ratios for a photo library.

🎵

Audio format decisions

Compare FLAC vs MP3 vs WAV size tradeoffs for a music library.

☁️

Cloud storage cost reduction

Quantify storage savings from compressing data before uploading to object storage.

🔍

Sanity-checking a new encoder

Verify a newly configured compression pipeline performs as expected.

📊

Reporting storage savings

Generate concrete percentage-saved figures for a storage optimization report.

🎓

Teaching compression concepts

Use it in a course to make ratio vs percentage-saved concrete for students.

🔁

Re-checking after a settings change

Verify a compression-level change actually improved your ratio meaningfully.

Pros & Cons

Benefits and Limitations

What this compression ratio calculator does well, and where it can't replace real testing

✅ Benefits

  • Free, instant, and requires no signup or account
  • Works in either direction — solve from original or compressed size
  • Shows both ratio (X:1) and percentage saved formats
  • Reference table of typical real-world ratios for sanity-checking
  • Visual doughnut chart of size proportion
  • Handles KB, MB, and GB with automatic unit conversion
  • Downloadable plain-text summary of your result
  • Fast-loading, mobile-friendly, runs entirely in your browser
  • Useful for both lossless and lossy compression comparisons
  • No file upload required — just enter the two sizes

⚠️ Limitations

  • Doesn't measure compression or decompression speed
  • Doesn't assess lossy compression's quality/fidelity tradeoff
  • Reference ratios are typical figures, not guarantees for your specific file
  • Requires you to already have both sizes — doesn't run compression itself
  • Doesn't distinguish container overhead from actual data compression
  • Not a substitute for testing multiple tools/settings on your real data
Reference

Typical Compression Ratios by Format

Industry-typical ratios for common compression scenarios

Format / ScenarioTypical RatioSpace Saved
ZIP (general mixed files)~2:1~50%
Gzip (plain text)~3:1 or better~67%+
SQL dump (gzip)4:1 – 10:175% – 90%
H.265 vs H.264 (same quality)~2:1~50%
JPEG vs PNG (photos)5:1 – 10:180% – 90%
FLAC vs WAV (audio)~2:1~50%
Already-compressed media re-zipped~1:1~0%

Common Mistakes and Expert Tips

❌ Common Mistakes

  • Comparing files of different quality/content when evaluating codec ratios
  • Expecting text-level compression ratios from already-compressed media
  • Mixing up KB/MB/GB units when entering sizes manually
  • Treating a low ratio on media files as a sign something is wrong
  • Ignoring compression level settings when comparing "the same" tool across runs
  • Assuming a higher ratio is always better without considering speed/quality tradeoffs

💡 Expert Tips & Best Practices

  • Use the reference table to sanity-check whether your ratio is in the expected range for the data type
  • Pair with the File Size Calculator to estimate original size before running a compression test
  • Test multiple compression levels (fastest to maximum) to find your speed/ratio sweet spot
  • For lossy formats, always verify perceptual quality alongside the ratio, not size alone
  • Re-run this calculator whenever you change compression tools or settings to confirm the actual impact
📝

Summary: This compression ratio calculator gives you an instant, free way to compute compression ratio and space saved between any two file sizes, with a reference table to sanity-check your result against typical industry figures. Pair it with the File Size Calculator and Storage Converter for a complete file-size toolkit.

FAQ

Frequently Asked Questions

Common questions about compression ratio calculator results

How is compression ratio calculated?
Compression ratio = original size ÷ compressed size, usually expressed as X:1. For example, a 100 MB file compressed to 25 MB has a compression ratio of 4:1 — meaning the original is 4 times larger than the compressed version.
What's a good compression ratio?
It depends entirely on the data type. General-purpose tools like ZIP typically achieve around 2:1 on mixed files. Text compresses well with gzip at roughly 3:1 or higher. Already-compressed formats like JPEG, MP3, or MP4 barely compress further (often under 1.1:1) because the redundancy has already been removed.
What is the difference between compression ratio and space saved percentage?
Compression ratio compares the two sizes as a multiple (e.g. 4:1), while space saved percentage expresses the reduction as a share of the original: space saved % = (1 − compressed/original) × 100. A 4:1 ratio corresponds to 75% space saved, since the compressed file is one-quarter the original size.
Why doesn't my video/image/audio file compress much further with ZIP?
Formats like MP4 (H.264/H.265), JPEG, and MP3 are already compressed using algorithms tuned for that data type. Running general-purpose compression like ZIP on top rarely helps and can occasionally make the file slightly larger, because there's little redundant data left to remove.
How much smaller is H.265 than H.264 at the same quality?
H.265 (HEVC) typically compresses video to about half the bitrate of H.264 for the same visual quality, giving a roughly 2:1 compression ratio relative to H.264 — one reason streaming services and modern cameras have widely adopted it.
What's the difference between lossless and lossy compression?
Lossless compression (ZIP, gzip, PNG, FLAC) reconstructs the exact original data on decompression — nothing is discarded. Lossy compression (JPEG, MP3, most video codecs) permanently discards some information judged less perceptible to humans, which is why it can reach much higher compression ratios. This calculator's ratio and space-saved numbers apply the same way to either type — it only compares sizes, not fidelity.
Why do two ZIP tools give different compression ratios on the same file?
Compression ratio depends on the specific algorithm implementation, compression level setting (e.g., "fastest" vs "maximum"), and dictionary size a tool uses, even when both claim to use the same underlying format like DEFLATE. A tool set to maximum compression will typically produce a smaller file — and therefore a higher ratio — than the same tool at its fastest setting, at the cost of more CPU time.
What compression ratio should I expect for database backups?
It varies by database content, but SQL dump files (largely repetitive text) often compress 4:1 to 10:1 with gzip, since structured, text-based exports have a lot of redundancy. Binary backup formats with already-compressed BLOBs or encrypted columns will compress far less. Run this calculator on your actual dump size before and after compressing to see your specific ratio.
Does compression ratio measure compression speed?
No. Compression ratio only measures how much smaller the output file is relative to the input — it says nothing about how long compression or decompression took. A slower algorithm or higher compression level often achieves a better ratio, so ratio and speed are generally a tradeoff, not two views of the same number.
What's the difference between gzip and ZIP?
Both commonly use the same underlying DEFLATE compression algorithm, so their compression ratio on a single file is often similar. The difference is mostly in the container format: gzip typically compresses a single stream (often paired with tar for multiple files), while ZIP is an archive format that can hold and individually compress multiple files with directory structure.
Is a higher compression ratio always better?
Not necessarily. A higher ratio saves more storage and bandwidth, but usually costs more CPU time and memory to compress and decompress, and for lossy formats can mean visible quality loss. The "best" ratio is the one that fits your speed, quality, and storage tradeoffs — real-time streaming favors fast, moderate compression, while cold storage archives favor maximum ratio regardless of speed.
How does compression level (1–9) affect the ratio?
Most DEFLATE-based tools (gzip, ZIP) expose a level from 1 (fastest, lowest ratio) to 9 (slowest, highest ratio). Going from level 1 to level 9 typically improves the ratio by 10–20% on text data, with diminishing returns near the top — level 6 (the common default) usually captures most of the achievable savings well before level 9's extra CPU cost.
Will decompressing a lossless-compressed file give back the exact original data?
Yes — that's the defining property of lossless compression (ZIP, gzip, Brotli, Zstandard, FLAC, PNG). Every bit of the decompressed output matches the original input exactly, which is essential for backups, source code, databases, and any data where the smallest change matters. Lossy formats like JPEG or MP3 do not offer this guarantee.
Why might a compressed file end up larger than the original?
This happens when the input data has little or no redundancy for the algorithm to exploit — already-compressed files (JPEG, MP4, ZIP), encrypted data, or random data are common examples. Compression formats also add a small amount of header and metadata overhead, so on a tiny or incompressible file that overhead can push the "compressed" size slightly above the original, giving a ratio just under 1:1.
How do I calculate space saved if I only know the percentage?
If you know the space-saved percentage, compressed size = original size × (1 − percentage ÷ 100). For example, 75% space saved on a 500 MB file means the compressed file is 500 × (1 − 0.75) = 125 MB. Enter that computed compressed size into this calculator alongside the original to confirm the resulting ratio.
What's a typical compression ratio for text logs versus binary data?
Plain-text application logs are highly repetitive (timestamps, field names, common messages) and typically compress 5:1 to 10:1 or better with gzip. Generic binary data — compiled executables, already-compressed media, or encrypted blobs — usually compresses far less, often in the 1:1 to 2:1 range, because it lacks the repeated patterns that text-based compression algorithms exploit.
Learn More

Authoritative Resources on Data Compression

Official standards documentation to complement this calculator

Related Calculators

Explore other tech tools