Skip to main content
HSCalculadora

Compression Ratio Calculator

Find the ratio and percentage saved after compression.

KB
KB

Results update as you type.

Space saved
—
Compression ratio—
Kilobytes saved—

How it works

A compression ratio calculator measures how effectively data was compressed, from the original size and the compressed size. It reports three complementary views: the compression ratio, the percentage of space saved, and the absolute kilobytes removed. Compression underpins fast websites, efficient storage, and quick transfers, so knowing how much a tool like gzip, Brotli, or an image optimiser actually saved helps you judge whether the effort paid off. This matters across web performance and storage. A web developer enabling gzip or Brotli on a server wants to confirm that text assets shrink meaningfully, since smaller responses load faster and cost less bandwidth. Someone archiving files wants to know whether a format is worth the slower compression time. Expressing the result three ways suits different audiences: ratios for technical comparison, percentages for intuitive impact, and kilobytes for concrete transfer savings. The calculation works because compression ratio is original divided by compressed, so 4:1 means the data is a quarter of its former size. The percentage saved is one minus the ratio of compressed to original, showing directly how much was eliminated. Highly compressible text can reach 70 to 90 percent savings, while already-compressed formats like JPEG or MP4 barely shrink. Developers, sysadmins, and anyone optimising files use a compression ratio calculator to quantify and compare how well their data compresses.

Formula

saved % = (1 − compressed ÷ original) × 100 · ratio = original ÷ compressed

The compression ratio compares sizes before and after by dividing the original size by the compressed size, so a value of 4 means the data shrank to a quarter and is written as 4 to 1. The percentage saved is the share of the original that disappeared, one minus the compressed fraction, as a percentage. Kilobytes saved is the plain difference between the two sizes. Together these express the same shrinkage as a ratio, a percentage, and an absolute amount.

Source:Standard data compression

We review all our tools from time to time to ensure accuracy.

Worked example

Original size:100Compressed size:25
Ratio 100 ÷ 25 = 4:1; saved (1 − 25 ÷ 100) × 100 = 75%; 75 KB removed.

How to use this calculator

  1. 1

    Enter your values

    Enter original size and compressed size.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Space saved updates instantly as you type — no button to press.

Frequently asked questions

What is a good compression ratio?

It depends entirely on the data. Plain text, HTML, CSS, and JavaScript compress extremely well, often reaching ratios of 4:1 to 10:1, meaning 75 to 90 percent savings. Already-compressed formats like JPEG images, MP3 audio, and MP4 video barely shrink further, since their redundancy is already removed. There is no universal target: judge a ratio against what is typical for that kind of content rather than against an absolute benchmark.

How does the ratio relate to percentage saved?

They describe the same shrinkage differently. A ratio of 4:1 means the compressed file is one quarter the original, so three quarters, or 75 percent, was saved. A 2:1 ratio saves 50 percent, and 10:1 saves 90 percent. The ratio emphasises how many times smaller the data became, while the percentage emphasises the share removed. Use whichever framing communicates the result most clearly to your audience.

Why do some files barely compress?

Compression works by removing redundancy and predictable patterns. Files that are already compressed, such as JPEG, PNG, MP3, MP4, and ZIP archives, have had most of their redundancy stripped, so little remains to remove and the ratio stays near 1:1. Encrypted data looks random and compresses even less. Trying to compress such files again wastes time and can occasionally make them slightly larger due to added container overhead.

What is the difference between gzip and Brotli?

Both compress web assets, but Brotli, developed more recently, typically achieves higher ratios on text than gzip, especially at its stronger settings, thanks to a built-in dictionary and better modelling. Gzip is older, universally supported, and faster to compress. Many servers offer both and pick based on what the browser accepts. This calculator measures the actual saving from whichever tool you used, letting you compare their real results on your own files.

Does higher compression always help performance?

Not always. Stronger compression shrinks files more but takes longer to compress and sometimes to decompress, which can matter for content generated on the fly. For static assets compressed once and served many times, maximum compression is usually worth it. For dynamic responses, a balanced level avoids adding server delay. Weigh the transfer time saved against the processing cost, using the space saved here as one side of that trade-off.