Glossary

Compression Ratio

The ratio of a file's original size to its compressed size — a measure of how effectively a compression algorithm reduces file size.

Last updated

What Is Compression Ratio?

Compression ratio is the relationship between the original (uncompressed) file size and the compressed file size:

Compression ratio = Original size ÷ Compressed size

A file compressed from 10 MB to 2 MB has a compression ratio of 5:1 (or 80% reduction).

Typical Compression Ratios by File Type

File TypeCompression MethodTypical RatioWhy
Plain text (.txt)ZIP/DEFLATE3:1 to 10:1High pattern repetition
HTML/XMLZIP/DEFLATE4:1 to 8:1Repeated tags and text
DOCX/XLSXZIP (already)1:1 to 1.5:1Already ZIP-compressed internally
PDF (text)ZIP1.2:1 to 2:1Already partially compressed
PDF (scanned)Image recompression2:1 to 5:1Images compress well
PNG → JPGLossy3:1 to 10:1 (photos)Format change, data discarded
JPG (Q100) → JPG (Q85)Quality reduction3:1 to 5:1Less data kept
RAW photoJPEG conversion5:1 to 10:1Massive data discarded
MP4 videoRe-encode2:1 to 4:1Depends on original bitrate

Why Some Files Don't Compress

Files that are already compressed — JPEG images, MP3/MP4 media, DOCX/XLSX (which are ZIP inside) — produce near 1:1 compression ratios when zipped. The compression algorithm finds no patterns to exploit because the data is already pseudo-random.

Attempting to ZIP a folder of JPEG photos produces a ZIP file approximately the same size as the original photos. The only gain is the single-file convenience of the archive.

Maximising Compression

For the best compression ratio:

  1. Choose the right algorithm for your content type (DEFLATE for text, JPEG for photos)
  2. Compress at the earliest stage — before other processing
  3. Never compress already-compressed data (ZIP of ZIPs, JPEG of JPEGs)