Skip to content

Lossy vs Lossless Compression: What's the Difference?

What each kind of image compression keeps and throws away, which formats use which, and how to pick the right one for photos, graphics and archives.

Updated PixelConvertor

Short answer

Lossless compression makes a file smaller without changing a single pixel. Lossy compression removes detail the eye is unlikely to notice and often makes files several times smaller, at the cost of a small, permanent loss of quality. Use lossy compression for photos on the web and in email, and lossless for graphics, screenshots, files you will keep editing and archives.

How lossless compression works

A lossless compressor looks for patterns and stores them more efficiently, much like a ZIP file. A row of 500 identical white pixels can be written as "500 white pixels" instead of 500 separate values. When the image is opened, the pixels are rebuilt exactly.

This works very well on graphics with flat colors, text and sharp edges, where neighboring pixels repeat. It works poorly on photos, whose natural noise means almost no two pixels are the same, which is why a photo saved as PNG is often several times larger than the same photo as JPG.

How lossy compression works

A lossy compressor decides which information matters least and throws it away before compressing the rest. JPEG, for example, splits the image into 8 × 8 pixel blocks, converts each block into frequencies, and stores fine detail and color with less precision than brightness, because the eye is less sensitive to them. The quality setting controls how much is discarded.

At high quality settings the difference is very hard to see, and files are still much smaller than lossless ones. At low settings artifacts appear: blocks in smooth areas, halos around sharp edges and colors bleeding into each other. The removed detail is gone for good, and saving a lossy file again at a lossy setting removes a little more each time.

Which formats use which

FormatLosslessLossy
PNGYes, alwaysNo (but colors can be reduced before saving)
JPGNo (in everyday use)Yes, always
WebPYes, separate modeYes, the usual mode
AVIFYes, rarely usedYes, the usual mode
GIFYes, up to 256 colorsNo (but colors are reduced to fit 256)
HEICPossible, rarely usedYes, the usual mode on phones

The PNG and GIF rows show a subtle point. The compression itself is lossless, but squeezing an image into a palette of 256 colors or fewer already changes pixels. Our PNG compressor offers both: a lossless mode that only recompresses the data with oxipng, and a fewer colors mode that reduces the palette first for much smaller files.

Which one to choose

For photos on websites, in email and on social media, lossy compression is almost always right. JPG at quality 75 to 85 looks very close to the original in most photos, and WebP and AVIF are often smaller still. The JPG compressor and the WebP compressor let you set the quality and preview the size.

For logos, icons, screenshots and anything with text, use lossless compression or a reduced palette, so edges stay clean. For originals you will edit again, keep a lossless copy and export lossy versions from it as needed.

When a form or a platform sets a maximum file size, the choice is made for you: lossy compression plus, if needed, smaller dimensions. Compress image to size picks the highest quality that fits 100 KB, 50 KB or any other target, and the image compressor handles everyday compression of JPG, PNG, WebP and AVIF files.

Compress your images

Frequently Asked Questions

What is the difference between lossy and lossless compression?

Lossless compression stores the same pixels in fewer bytes, and decompressing gives back the exact original. Lossy compression also removes detail that is hard to see, which makes files much smaller, but the removed detail can't be recovered.

Is PNG lossy or lossless?

PNG compression is lossless. A PNG can still lose information before it is compressed, for example when its colors are reduced to a palette of 256 or fewer, which is what the fewer colors mode of our PNG compressor does.

Is JPG always lossy?

The JPG files you meet in practice are always lossy, even at quality 100, because of rounding and reduced color resolution. At quality 90 and above the loss is very hard to see in photos.

Does WebP use lossy or lossless compression?

Both. WebP has a lossy mode for photos and a separate lossless mode that keeps every pixel. Our WebP compressor and converters have a Lossless WebP switch.

Does compressing the same image again lose more quality?

With lossless compression, no: you can save as often as you like. With lossy compression, each new save at a lossy setting can remove a little more detail, so compress from the best original you have.