Images

What is Lossless compression?

Also called lossless.

Lossless compression reduces the space needed to store data while allowing the original to be recovered exactly, bit for bit.

How it works

Lossless compression works by finding patterns and describing them more efficiently. A row of 500 identical white pixels can be stored as “500 × white” instead of 500 separate values. Decompression reverses the process and restores every original byte.

PNG uses lossless image compression, ZIP compresses files losslessly, and PDF uses it for text and line art. The possible saving depends on how much redundancy the input contains, which is why a screenshot of a document compresses far better than a photo of a forest.

Lossless vs lossy

Lossless compression keeps everything and saves less. Lossy compression discards information to save much more. For photos, lossy formats such as JPEG are usually the right trade-off. For text, spreadsheets, program files, screenshots and anything you will edit again, lossless is the only safe choice.

A practical example

A simple graphic with large flat areas can compress well as PNG. Adding an already compressed JPEG to a ZIP archive may save almost nothing.

What to watch out for

A lossless output format doesn’t undo earlier quality loss. Converting a blurry JPEG to PNG preserves the blur exactly, in a larger file.

Tools you can use

Go a little deeper

Common questions

How much can lossless compression save?

It depends entirely on redundancy in the data. Text and flat graphics often shrink by 60 to 90 percent; photos by much less; files that are already compressed barely at all.

Is PNG always lossless?

The PNG format itself is. Some tools reduce the number of colors before saving a PNG to make it smaller, which is a lossy step even though the file is a PNG.

Which image formats are lossless?

PNG, GIF (within its 256 colors), lossless WebP, lossless AVIF, BMP and most TIFF files. JPEG is always lossy.

Related terms

Browse the complete file format glossary →