# Compression Ratio Calculator

Convert between compression ratio and space saved, and price the storage and transfer time it buys.

---

- **Canonical URL:** https://dothecalculation.com/calculators/compression-ratio-calculator
- **Category:** AI & Tech Development
- **Publisher:** Do The Calculation (https://dothecalculation.com)
- **Cost:** Free, no account or sign-up required
- **Privacy:** Runs entirely in the browser; inputs are never sent to a server
- **Methodology:** https://dothecalculation.com/methodology

---

## Compression Ratio and Space Savings

Convert between compression ratio and space saved, and turn either into the storage cost and transfer time the compression actually buys you.

- Ratio and space saving side by side — a 4:1 ratio is 75% saved, not 25%
- Storage cost saved per month and per year at your own rate
- Transfer time recovered at your own connection speed

## Quick Answer — How Do You Calculate Compression Ratio?

Divide the original size by the compressed size: \(\text{Ratio} = \frac{\text{Original}}{\text{Compressed}}\), conventionally written as N:1. Space saving is the same result as a percentage: \(\text{Space Saving} = \left(1 - \frac{\text{Compressed}}{\text{Original}}\right) \times 100\%\).

**Worked example:** a 200 MB file compressed to 50 MB. Ratio = 200 ÷ 50 = **4**, written **4:1**. Space saving = (1 − 50/200) × 100 = **75%**. Both describe the identical file.

The two are linked by \(\text{Space Saving} = 1 - \frac{1}{\text{Ratio}}\), and that relationship explains why compression has such steep diminishing returns:

• **1.5:1** — 33.33% saved

• **2:1** — 50.00% saved

• **3:1** — 66.67% saved

• **4:1** — 75.00% saved

• **8:1** — 87.50% saved

• **16:1** — 93.75% saved

Going from 2:1 to 4:1 buys another 25 percentage points. Going from 8:1 to 16:1 buys 6. Past roughly 10:1 there is almost nothing left to win, however impressive the ratio sounds — which is worth remembering when a format promises a dramatically higher number for dramatically more CPU time.

## How to Use This Calculator: A 200 MB Archive

Enter both sizes in the same unit — the ratio is unit-independent, so as long as they match the result is correct. For a 200 MB dataset that compresses to 50 MB, at a typical object-storage rate of $0.023 per GB per month and a 100 Mbps connection:

Ratio = 200 ÷ 50 = **4.00:1**. Space saving = **75.00%**. The compressed file is **25%** of the original, and **150 MB** (150,000,000 bytes) is recovered.

That translates to **0.15 GB** of storage, worth **$0.003 a month** — negligible, which is the honest answer for a single file. Transfer is where the value is at this scale: at 100 Mbps the original takes **16.0 seconds** and the compressed file **4.0 seconds**, a saving of **12.0 seconds** every time it moves.

That last point is the general one. For a single archive, compression is almost never about storage cost; it is about the time and bandwidth spent moving the thing, multiplied by how often you move it.

## A Second Example: Where Compression Pays for Itself

Scale changes which half matters. Take a 2 TB backup set that compresses to 640 GB, at the same $0.023 per GB per month, transferred over a 1 Gbps link.

Ratio = 2,000 ÷ 640 = **3.13:1**, a **68.00%** space saving, recovering **1,360 GB**. At $0.023 per GB that is **$31.28 a month** and **$375.36 a year** — a real, recurring line item rather than a rounding error.

Transfer improves in the same proportion: at 1 Gbps the uncompressed set takes **16,000 seconds** (4 hours 27 minutes) against **5,120 seconds** (1 hour 25 minutes) compressed, saving **10,880 seconds** — just over **3 hours** on every full transfer.

Note that the ratio here (3.13:1) is *lower* than the single archive's 4:1, and yet this is the case where compression obviously pays. Ratio alone tells you nothing about value; ratio multiplied by volume and by how often you store and move the data is what decides it.

## What Actually Compresses, and What Doesn't

Compression works by removing redundancy, so how well it works is a property of the data rather than of the algorithm. Rough expectations: plain text, logs, and CSV compress extremely well, frequently **5:1 to 10:1** or beyond, because natural language and structured records repeat heavily. Source code and JSON typically land around **3:1 to 5:1**. Database dumps and uncompressed images vary widely with content.

Already-compressed formats barely move. JPEG, PNG, MP4, MP3, and ZIP files have had their redundancy removed already, and running a general-purpose compressor over them usually yields under **1.1:1** — sometimes slightly *larger* output, because the container adds a header to data it could not shrink. Compressing an archive of photos or video is one of the most common wasted operations in backup pipelines, and the calculator will show it plainly: enter a ratio near 1 and the savings collapse to nothing.

The trade-off this calculator does not price is CPU time. Higher compression levels cost disproportionately more processor time for progressively smaller gains — the same diminishing-returns curve as the ratio itself, viewed from the other side. A modern fast codec at a moderate level usually beats a slow one at maximum, once you count the time spent compressing and decompressing on every access.

To decide whether a saving is worth having, size the underlying data first: the [data storage calculator](/calculators/data-storage-calculator) turns file counts into a GB total, the [cloud storage plan comparison calculator](/calculators/cloud-storage-plan-comparison-calculator) prices the storage you would otherwise buy, and the [download time calculator](/calculators/internet-download-time-calculator) covers the transfer side for a specific file and connection.

## Limitations

This calculator performs exact arithmetic on the two sizes you enter. It cannot predict what ratio your data will achieve — that depends entirely on the content and the algorithm, and the only reliable way to know is to compress a representative sample and measure it. Published benchmark ratios are measured on standard corpora that may look nothing like your files.

It prices storage and transfer but not compute. Compression costs processor time on write and decompression costs it on every read, which on hot data accessed constantly can outweigh the storage saved. It also does not model the difference between lossless and lossy compression: a 10:1 ratio from a lossless algorithm and a 10:1 ratio from re-encoding an image at lower quality are the same number describing entirely different trade-offs, and only one of them is reversible.

The storage saving assumes a flat per-GB rate. Real storage pricing has tiers, minimum object sizes, retrieval fees on archive classes, and per-request charges — and compression that produces many small objects can cost more in requests than it saves in bytes. Transfer time assumes the full line rate with no protocol overhead, latency, or contention, so treat it as a best case rather than a prediction.

## Related Calculators

Size the data before deciding what compression is worth: the [Data Storage Calculator](/calculators/data-storage-calculator) turns photo, video, and document counts into a GB total, and the [Video File Size Calculator](/calculators/video-file-size-calculator) covers media specifically — the category where compression is already applied and further gains are minimal. The [Cloud Storage Plan Comparison Calculator](/calculators/cloud-storage-plan-comparison-calculator) prices the storage a good ratio saves you from buying, and the [Download Time Calculator](/calculators/internet-download-time-calculator) estimates transfer time for a specific file and connection speed.

## Frequently asked questions

### How do you calculate compression ratio?

Divide the original size by the compressed size and write it as N:1. A 200 MB file compressed to 50 MB gives 200 ÷ 50 = 4, a 4:1 ratio. Both sizes must be in the same unit, but which unit does not matter — the ratio is unit-independent.

### Is a 4:1 compression ratio 25% or 75% savings?

75%. This is the most common mistake on the topic. The compressed file is 25% of the original size, which means 75% of the space was saved. The general relationship is Space Saving = 1 − 1/Ratio.

### What is a good compression ratio?

It depends entirely on the data. Plain text, logs, and CSV commonly reach 5:1 to 10:1; source code and JSON typically 3:1 to 5:1; already-compressed formats like JPEG, MP4, and ZIP barely exceed 1.1:1 because their redundancy has already been removed. A ratio is only meaningful compared against others on the same kind of data.

### Why does compressing a ZIP or JPEG file not help?

Because compression removes redundancy, and those formats have already removed it. Running a general-purpose compressor over them typically yields under 1.1:1, and sometimes produces slightly larger output because the new container adds a header to data it could not shrink.

### Why do compression savings flatten out at high ratios?

Because savings follow 1 − 1/Ratio, which approaches 100% asymptotically. 2:1 saves 50%, 4:1 saves 75%, 8:1 saves 87.5%, and 16:1 saves 93.75% — so doubling the ratio from 8:1 to 16:1 buys only 6 more percentage points, for substantially more CPU time.

### How much money does compression actually save?

Multiply the bytes saved by your storage rate. A 2 TB backup compressed to 640 GB recovers 1,360 GB, which at $0.023 per GB per month is $31.28 a month or $375.36 a year. For a single 200 MB file the same maths gives a third of a cent — at small scale, compression is about transfer time rather than storage cost.

### Does this calculator account for CPU cost?

No. Compression costs processor time on write and decompression costs it on every read, and for hot data accessed constantly that can outweigh the storage saved. Higher compression levels follow the same diminishing-returns curve as the ratio itself, so a fast codec at a moderate level often beats a slow one at maximum.

### What is the difference between lossless and lossy compression here?

The calculator treats both identically, because it only sees two file sizes — but they are not equivalent decisions. A 10:1 lossless ratio reconstructs the original exactly; a 10:1 lossy ratio has thrown away data permanently. Compare ratios only within the same category.

## Related concepts

- **Compression Ratio** — Original size divided by compressed size, written N:1. A ratio of 4 means the compressed file is a quarter the size of the original.
- **Space Saving** — The same measurement as a percentage: 1 − 1/Ratio. A 4:1 ratio is a 75% space saving, and the relationship is why gains flatten sharply above about 10:1.
- **Incompressible Data** — Content whose redundancy has already been removed — JPEG, MP4, MP3, ZIP. General-purpose compression on these yields under 1.1:1 and can produce slightly larger output.

## Related guides

- [How to Use Do The Calculation Calculators: A Practical Step-by-Step Guide](https://dothecalculation.com/blog/site-guides/how-to-use-calculators) — Learn the fastest reliable workflow for using Do The Calculation calculators, reading results, checking formulas, and using save, print, share, and export actions correctly.
- [Understanding Calculator Formulas: How DTC Turns Inputs into Results](https://dothecalculation.com/blog/site-guides/understanding-calculator-formulas) — Understand how Do The Calculation formulas are presented, what the explanation blocks mean, and how to verify calculator logic before using a result in a real decision.

## Related calculators

- [Docker Image Layer Size Optimizer](https://dothecalculation.com/calculators/docker-image-optimizer-calculator) — Model Docker container layer sizing, registry storage needs, and deployment transfer time overhead for image optimization planning.
- [VPS & Server Cost Calculator](https://dothecalculation.com/calculators/vps-server-cost-calculator) — Price a VPS by vCPU, RAM, storage, transfer, support, and backups, with annual prepay and yearly totals.
- [Cloud Storage & Egress Cost Calculator](https://dothecalculation.com/calculators/cloud-egress-cost-calculator) — Compare bandwidth transfer and data egress costs across AWS, Google Cloud, Azure, and Cloudflare R2 storage providers instantly.
- [Scale Converter Calculator](https://dothecalculation.com/calculators/scale-converter) — Convert dimensions between drawing, model, and real-world scales instantly using any common scale ratio for accurate results.
- [CI/CD Minutes Cost Calculator](https://dothecalculation.com/calculators/cicd-minutes-cost-calculator) — Price GitHub Actions minutes with per-job rounding, OS multipliers, and the included allowance on your plan.
- [Cloud Storage Plan Cost Comparison Calculator](https://dothecalculation.com/calculators/cloud-storage-plan-comparison-calculator) — Compare cloud storage plans on cost per TB, cost per GB you actually store, and five-year total.

---

_This calculator performs exact arithmetic on the two sizes you enter. It cannot predict the ratio your data will achieve — that depends on content and algorithm, and the only reliable method is to compress a representative sample and measure. It prices storage and transfer but not the CPU time compression costs, treats lossless and lossy results identically because it only sees file sizes, and assumes a flat per-GB storage rate and full line-rate transfer with no protocol overhead._

---

_Source: [Do The Calculation](https://dothecalculation.com/calculators/compression-ratio-calculator). Quote freely with attribution and a link to this page._
