Data compression ratio calculator

Enter how big the data was before and after compression — a ZIP or gzip file, a database backup, a compressed image or a Brotli-encoded page. The calculator gives the compression ratio, the percentage of space saved and how many bits each original byte now takes.

Unit
Compression ratio4 : 1
Space savings75 %
Compressed size, % of original
25 %
Space saved
187.5 MB
Bits per original byte
2

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the original size and the compressed size.
  2. Pick the unit both sizes are in; it only affects how the saved space is shown.
  3. Read the ratio, the savings and the bits per byte.

Formulas

  • Compression ratio = original ÷ compressed (written as x:1)
  • Space savings = (1 − compressed ÷ original) × 100 %
  • Compressed share = compressed ÷ original × 100 %
  • Space saved = original − compressed
  • Bits per byte = 8 × compressed ÷ original

Worked example

A 1,000 KB log file compresses to 320 KB:

  • ratio: 1000 ÷ 320 = 3.125 : 1;
  • savings: 1 − 320 ÷ 1000 = 68 %, so the file is 32 % of its original size;
  • space saved: 680 KB;
  • bits per byte: 8 × 0.32 = 2.56.

Tips

  • Text compresses well, media does not. Logs, CSV and JSON often shrink 4–10 times; photos, video and archives barely shrink again.
  • Compare like with like. Measure all compressors on the same input and at the same level; a higher level gives a better ratio but takes more time.
  • To see how long the compressed file takes to transfer, use the download time calculator.

Frequently asked questions

How do you calculate a compression ratio?

Divide the original size by the compressed size. 250 MB that compresses to 62.5 MB gives 250 ÷ 62.5 = 4, written 4:1 — the data now takes a quarter of the space. Both sizes must be in the same unit; the unit itself does not change the ratio.

What is the difference between the ratio and space savings?

Space savings is 1 − compressed ÷ original, as a percentage. A 4:1 ratio saves 75 %, 2:1 saves 50 % and 10:1 saves 90 %. Savings grow ever more slowly as the ratio rises: going from 10:1 to 20:1 only adds 5 points.

What does bits per byte mean?

How many bits of compressed output each byte of input costs: 8 × compressed ÷ original. Uncompressed data is 8 bits per byte; 2 bits per byte equals a 4:1 ratio. It is the usual unit in compression benchmarks and can be compared with the data's entropy.

Why is my compressed file bigger than the original?

Data that is already compressed or random — JPEG, MP4, ZIP files, encrypted data — has no redundancy left, so the container's headers make the file slightly larger. The calculator then shows a ratio below 1:1 and negative savings.

More in Developer

All tools in this category: Developer ·Updated November 7, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.