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 Type | Compression Method | Typical Ratio | Why |
|---|---|---|---|
| Plain text (.txt) | ZIP/DEFLATE | 3:1 to 10:1 | High pattern repetition |
| HTML/XML | ZIP/DEFLATE | 4:1 to 8:1 | Repeated tags and text |
| DOCX/XLSX | ZIP (already) | 1:1 to 1.5:1 | Already ZIP-compressed internally |
| PDF (text) | ZIP | 1.2:1 to 2:1 | Already partially compressed |
| PDF (scanned) | Image recompression | 2:1 to 5:1 | Images compress well |
| PNG → JPG | Lossy | 3:1 to 10:1 (photos) | Format change, data discarded |
| JPG (Q100) → JPG (Q85) | Quality reduction | 3:1 to 5:1 | Less data kept |
| RAW photo | JPEG conversion | 5:1 to 10:1 | Massive data discarded |
| MP4 video | Re-encode | 2:1 to 4:1 | Depends 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:
- Choose the right algorithm for your content type (DEFLATE for text, JPEG for photos)
- Compress at the earliest stage — before other processing
- Never compress already-compressed data (ZIP of ZIPs, JPEG of JPEGs)