Compression ratio or space saving?
Two ways to say how much smaller a file got
Ratio and saving describe the same result in different ways, and mixing them up is a common reporting error.
Calcylator Editorial Team
Updated · 5 min read
Ratio and saving: two views of one result
When a tool says it compressed a file, it may report a ratio such as 4:1 or a saving such as 75 percent. They convey the same information from different angles. The ratio compares the original with the result, and the saving states what share of the original disappeared.
- original size:
- bytes before compression
- compressed size:
- bytes after compression
- result:
- as a decimal; multiply by 100 for percent
Original
48 MB
Compressed
12 MB
Result
4:1 ratio, 75% space saved
48 ÷ 12 = 4. 1 − 12 ÷ 48 = 0.75.
Some tools and textbooks invert the ratio (12 ÷ 48 = 0.25, shown as 25 percent of original size). When reading a report, check which way round it is before comparing numbers.
Quick conversion between ratio and saving
| Ratio | Compressed size is | Space saved |
|---|---|---|
| 1.25 : 1 | 80% of original | 20% |
| 2 : 1 | 50% | 50% |
| 4 : 1 | 25% | 75% |
| 10 : 1 | 10% | 90% |
| 100 : 1 | 1% | 99% |
The table shows diminishing returns. Going from 2:1 to 4:1 frees another quarter of the original, but going from 10:1 to 100:1 frees only 9 percentage points. That is why a spectacular-sounding ratio of 100:1 is often not worth much extra effort when 10:1 already removes nine tenths of the data.
What determines how well data compresses
Compressors find redundancy: repeated patterns, predictable sequences and unused precision. Text, logs, JSON and uncompressed images contain a great deal and often shrink to a quarter or less. Data that is already compressed or encrypted looks random, and there is little left to remove.
- Lossless methods (ZIP, gzip, PNG, FLAC) restore the exact original, so the ratio depends entirely on redundancy.
- Lossy methods (JPEG, MP3, H.264) discard detail people are unlikely to notice, and the ratio is a quality choice.
- Compressing a JPEG or an MP4 into a ZIP typically saves almost nothing.
- Level settings trade time for ratio: higher levels take longer for a small extra gain.
Compression in transit: does it save time?
Smaller is only faster if the saved transfer time outweighs the compression work. On a 20 Mbps link the 48 MB file takes 48 × 8 ÷ 20 = 19.2 seconds to send. At a 4:1 ratio the 12 MB version takes 4.8 seconds, and even if compressing and unpacking cost 2 seconds, the total of 6.8 seconds is far ahead.
The advantage shrinks on fast links or when the data is already compressed, where only CPU time is added. That is why web servers compress text such as HTML, CSS and JSON but leave images and video alone.
Using the number for planning
Ratio turns directly into storage and bandwidth. A 120 GB log archive at 5:1 needs 24 GB. Over a link, compressed transfers take proportionally less time, though compression costs CPU on both ends.
For web delivery, gzip or Brotli on text assets commonly reduces transfer size substantially, which is why servers enable it by default. The only way to know your own figure is to measure on your own files, since the ratio is entirely data-dependent.
Archive
120 GB of logs
Ratio
5 : 1
Compressed size
24 GB
120 ÷ 5 = 24 GB, which is an 80% saving.
Common reporting mistakes
- Quoting savings as a ratio: calling a 75 percent saving 75:1 instead of 4:1.
- Comparing results across different data, since a ratio only means something for the same input.
- Ignoring metadata and container overhead on very small files, where the compressed output can even be larger.
- Averaging ratios across files instead of totalling bytes first: the overall ratio is total original divided by total compressed.
Many files, levels and honest averages
Compressors usually offer levels from fast to maximum. Higher levels search harder for repeats and take more time, with the extra saving often a few percentage points. For routine work the default is the sensible pick, and maximum is for archives written once and read rarely.
When you report on a batch, total the bytes first. Suppose one file shrinks from 10 MB to 2 MB (5:1) and another from 90 MB to 60 MB (1.5:1). Averaging the two ratios gives 3.25:1, yet the batch went from 100 MB to 62 MB, a true ratio of about 1.61:1. The big file dominates, as it should.
- Solid archives compress files together and gain more across similar files, but make extracting one file slower.
- Deduplication finds identical blocks across files and complements compression.
- Check that tools report the same way round before comparing two products.
Reading ratios quoted by tools and vendors
Headline figures such as up to 90 percent smaller describe a best case on friendly data. They are real, but they say little about your files. Ask what the test set was, whether the format was lossless, and whether the baseline was a fair one, such as an already optimised file or a bloated original.
Media shows the gap well. A 24 MP photo is 72 MB as raw 8-bit RGB, and a JPEG of it might be around 6 MB. That is 12:1, a saving of about 92 percent, but it is lossy: the original cannot be restored exactly. A lossless PNG of the same image typically lands far higher than the JPEG, since lossless methods can only exploit redundancy.
Raw image
72 MB
JPEG (assumed)
6 MB
Ratio and saving
12:1, 91.7% saved
72 ÷ 6 = 12; 1 − 6 ÷ 72 = 0.917.
Compare like with like: same input, same direction of ratio, and a note on whether quality was preserved.
A last practical point concerns decompression. Some methods compress slowly but unpack quickly, which suits data written once and read many times, while others favour speed in both directions and fit logs and live streams. Think about which side of the pipeline is the bottleneck, and about the memory a decompressor needs, before picking the format. A slightly lower ratio that your servers can unpack without strain is usually the better engineering choice.
Common questions
What is compression ratio?
It is the original size divided by the compressed size. A 48 MB file that becomes 12 MB has a ratio of 4:1. Higher ratios mean more compression, though some tools report the inverse, so check the definition.
How do I convert compression ratio to percentage saved?
Use 1 minus 1 divided by the ratio, then multiply by 100. A 4:1 ratio saves 1 − 0.25 = 75 percent. A 2:1 ratio saves 50 percent and 10:1 saves 90 percent.
Is a higher compression ratio always better?
Not always. Higher ratios often need more time and CPU, and lossy methods lose detail. Past about 10:1 the extra space saved is small, so choose the level that balances time, quality and size.
Why does a ZIP file sometimes get bigger?
Data that is already compressed or encrypted has little redundancy, so the archive only adds headers. Photos, videos and other ZIP files rarely shrink, and tiny files can grow slightly from metadata.
What is the difference between lossless and lossy compression?
Lossless compression restores every bit of the original, so the ratio depends on redundancy. Lossy compression discards detail to reach much higher ratios, as JPEG and MP3 do, and the original cannot be recovered exactly.
Was this guide helpful?
Continue reading
View all blogsHex to Decimal: Convert Hexadecimal by Hand
To turn hex into decimal, multiply each digit by a power of 16 and add: 1A3F becomes 6,719. Includes the A to F table, colour codes and a quick shortcut.
5 min read
IP Address Subnet Calculation: Network, Broadcast, Hosts
Give an IPv4 address and prefix and you can derive its network, broadcast and host range. 10.20.77.130/27 sits in 10.20.77.128 to .159 with 30 hosts.
4 min read
Subnet Mask From a Prefix: How /24 Becomes 255.255.255.0
A /24 prefix means 24 leading one-bits, which is 255.255.255.0 and 254 usable hosts. Learn to convert any prefix and find the network and broadcast address.
5 min read




