Technology

Compression Ratio Calculator

Calculator Free · Private
Reviewed by: (editorial policy ) · Last reviewed:
Was this calculator helpful?

This compression ratio calculator turns two numbers — your original file size and the compressed file size — into the three figures everyone actually wants: the compression ratio (e.g. 3.33:1), the percentage of space saved (e.g. 70%), and the absolute space saved in MB. The math is universal and unit-agnostic, so it works for ZIP archives, GZIP/Brotli web assets, H.265 video, database dumps or any other format. The core formula is Ratio = Original ÷ Compressed and Saving % = (1 − Compressed ÷ Original) × 100.

Last reviewed: June 3, 2026 Verified by Source: Wikipedia — Data compression ratio, RFC 7932 — Brotli Compressed Data Format (IETF), RFC 8878 — Zstandard Compression (IETF), RFC 1951 — DEFLATE Compressed Data Format (used by ZIP/GZIP) 100% private

Compression ratio = Original Size ÷ Compressed Size. A 100 MB file compressed to 30 MB has a ratio of 3.33:1, which means a 70% space saving (Rate = (1 − 30/100) × 100). Ratio is the "how many times smaller" number; rate is the percentage saved.

When to use this calculator

  • Auditing a ZIP archive: you compressed a 2,400 MB folder of office documents to 600 MB and want to confirm the 4:1 ratio (75% saved) before an offsite backup.
  • Web performance: comparing GZIP (typically 60–70% saved) vs Brotli (65–75% saved) on a 1,200 KB JavaScript bundle to decide which encoding to serve from your CDN.
  • Video production: a raw 80 GB 4K ProRes file becomes 4 GB after H.265/HEVC encoding — calculating the 20:1 ratio (95% saved) to justify storage to a client.
  • Database backups: a 50 GB PostgreSQL dump compressed with zstd to 12 GB; confirming the 4.17:1 ratio (76% saved) meets the storage SLA before moving to cold storage.
  • Sanity check: verifying that a 25 MB DOCX (already a ZIP container) gains almost nothing from re-zipping (ratio ≈ 1.05:1) so you stop wasting CPU on it.

Worked example: 100 MB → 30 MB

  1. Compression ratio = 100 ÷ 30 = 3.33:1
  2. Space saved % = (1 − 30 ÷ 100) × 100 = 70%
  3. Space saved = 100 − 30 = 70 MB
Result: 3.33:1 ratio = 70% saved (70 MB)

How it works

3 min read

How to calculate compression ratio

There are two numbers people mean when they say "compression ratio", and they come from the same two inputs:

# 1. Compression ratio (the "N:1" number)
Ratio = Original Size ÷ Compressed Size
Example: 100 MB ÷ 30 MB = 3.33  →  reported as 3.33:1

# 2. Space saved / compression rate (the percentage)
Saving % = (1 − Compressed Size ÷ Original Size) × 100
Example: (1 − 30 ÷ 100) × 100 = 70%

# 3. Space saved (absolute)
Space Saved = Original Size − Compressed Size
Example: 100 MB − 30 MB = 70 MB

The units cancel out, so it does not matter whether you enter MB, GB, KB or bytes — just keep both fields in the same unit. A ratio of 1:1 means no compression; anything below 1:1 (e.g. 0.98:1) means the "compressed" file is actually larger than the original, which is normal when you compress already-compressed data.

---

Ratio ↔ percentage quick conversion

Compression ratioSpace saved (%)
1.0:10%
1.25:120%
1.5:133%
2:150%
3:167%
3.33:170%
4:175%
5:180%
10:190%
20:195%
100:199%

Conversion formula: Saving % = (1 − 1 ÷ Ratio) × 100, and Ratio = 1 ÷ (1 − Saving %/100).

---

Typical compression ratios by file type

File / FormatAlgorithmTypical ratioTypical saving
Plain text (.txt, .log)GZIP / Deflate4:1 – 10:175% – 90%
Source code (.js, .css, .html)Brotli3:1 – 6:167% – 83%
Office docs (.docx, .xlsx)ZIP (internal)1.05:1 – 1.2:15% – 17%
JPEG / PNG imagesZIP / GZIP1.0:1 – 1.05:10% – 5%
RAW photo (e.g. Canon CR3)ZIP1.5:1 – 2.5:133% – 60%
Video — ProRes 4KH.265 / HEVC10:1 – 30:190% – 97%
Video — MP4 (H.264)H.265 / HEVC1.5:1 – 2:133% – 50%
Database dump (.sql)zstd / GZIP3:1 – 8:167% – 87%
Executable (.exe, .dll)ZIP1.5:1 – 2:133% – 50%
Already-compressed (.zip, .mp3, .mp4)ZIP≈ 1.0:1≈ 0%

Ratios are empirical averages; real results vary with the content's entropy.

---

Worked cases

Case 1 — Office document folder backup


A 2,400 MB folder of .docx and .xlsx files compresses to 600 MB.

Ratio       = 2,400 ÷ 600 = 4.0:1
Space saved = (1 − 600 ÷ 2,400) × 100 = 75%
MB saved    = 2,400 − 600 = 1,800 MB (≈ 1.76 GB)

Case 2 — JavaScript bundle on a CDN


A 1,200 KB unminified JS bundle compresses with Brotli to 210 KB.

Ratio       = 1,200 ÷ 210 = 5.71:1
Space saved = (1 − 210 ÷ 1,200) × 100 = 82.5%
KB saved    = 990 KB per request

At 500,000 requests/month that is roughly 495 GB of bandwidth saved.

Case 3 — Re-zipping an MP3


Zipping a 48 MB MP3 produces a 47.9 MB archive.

Ratio       = 48 ÷ 47.9 = 1.002:1
Space saved = (1 − 47.9 ÷ 48) × 100 = 0.21%
MB saved    = 0.1 MB

MP3 is already lossy-compressed (near-maximum entropy), so further lossless compression does almost nothing — the entropy ceiling.

---

Common mistakes

1. Confusing ratio with percentage. A 4:1 ratio is not 4% — it is 75% saved. Mixing them produces wildly wrong storage estimates.
2. Compressing already-compressed files. JPEG, MP3, MP4, ZIP and DOCX already contain compression; re-zipping yields < 1% and burns CPU.
3. Measuring after encryption. Encrypted data is near-random and compresses to ≈ 1:1. Always compress first, then encrypt.
4. Container overhead on tiny files. Headers, checksums and the central directory can make an archive of many sub-1 KB files bigger than the originals (ratio < 1:1).
5. Mismatched units. Original in MB and compressed in KB without converting is off by a factor of 1,024. Use the same unit in both fields.
6. Averaging ratios. Ratio depends on content entropy; average by total size, not by simple mean of per-file ratios.

Frequently asked questions

How do I calculate compression ratio?

Divide the original size by the compressed size: Ratio = Original ÷ Compressed. A 100 MB file compressed to 25 MB gives 100 ÷ 25 = 4, written 4:1. The units cancel out, so use MB, GB or bytes — just keep both values in the same unit.

What is the difference between compression ratio and compression rate?

Compression ratio (e.g. 3.33:1) is Original ÷ Compressed — how many times smaller the file is. Compression rate, also called space saving, is (1 − Compressed ÷ Original) × 100 — the percentage saved. A 2:1 ratio equals exactly 50% saved; a 10:1 ratio equals 90% saved. Vendors often quote whichever number looks bigger, so always check which one they mean.

How do I convert a compression ratio to a percentage?

Use Saving % = (1 − 1 ÷ Ratio) × 100. So 4:1 → (1 − 1/4) × 100 = 75%, and 5:1 → 80%. To go the other way: Ratio = 1 ÷ (1 − Saving%/100), so 60% saved → 1 ÷ 0.4 = 2.5:1.

What compression ratio should I expect from a ZIP file?

ZIP uses Deflate (LZ77 + Huffman). For plain text and logs expect 4:1 to 10:1 (75–90% saved). For mixed office documents, 2:1 to 4:1 (50–75%). For folders of images, video or already-zipped files you may see as little as 1.01:1 (< 1% saved).

Why is my compressed file larger than the original?

Because the source already has high entropy — it is already compressed or encrypted (MP3, JPEG, MP4, AES blobs, existing ZIPs). The algorithm can't remove redundancy but still adds headers and metadata, pushing the output above the original. The ratio drops below 1:1. This is normal, not a bug.

What is the best compression ratio achievable in practice?

For lossless compression of general data, above 10:1 is rare. Highly repetitive text (e.g. logs with repeated lines) can reach 100:1+ with GZIP. The hard limit is Shannon entropy: you can't losslessly compress below a file's information content. Lossy video formats like H.265 reach 30:1–50:1 by discarding perceptually irrelevant data.

Which algorithm gives the best ratio: ZIP, GZIP, Brotli or zstd?

Brotli (RFC 7932) and zstd (RFC 8878) usually beat GZIP/Deflate by 10–25% on text and web data. ZIP/Deflate is the most universally compatible. Rule of thumb: Brotli for HTTP responses, zstd for databases and backups, ZIP for cross-platform sharing.

Should I compress files before or after encrypting them?

Always compress first, then encrypt. Encryption turns data into pseudo-random bytes with near-maximum entropy, so compressing afterwards saves essentially 0%. Reversing the order wastes CPU for no size reduction.

Does compression ratio affect download or transfer speed?

Yes. HTTP supports GZIP and Brotli content-encoding. A 70% saving on a 500 KB HTML page sends only 150 KB, cutting transfer time on a slow connection by a few hundred milliseconds — a noticeable win on mobile.

How do I calculate space saved across thousands of files?

Sum every original size into one total and every compressed size into another, then apply Saving % = (1 − ΣCompressed ÷ ΣOriginal) × 100. Don't average per-file ratios — a 1 GB file at 2:1 should outweigh a 1 KB file at 10:1. Enter the totals into this calculator to get the aggregate ratio.

Sources and references