Compression basics

Lossless vs lossy compression: what's the difference?

The difference between lossless and lossy compression decides how small your images get, and whether they stay pixel-perfect. Here is a clear, jargon-free explanation with practical examples and a simple way to choose.

Every time you save an image for the web you are making a quiet decision about lossless vs lossy compression. Get it right and your files are small and sharp; get it wrong and you either waste bandwidth or introduce ugly artefacts. This guide explains the difference between lossless and lossy in plain terms, with real examples, so you always know which one to reach for.

What lossless compression means

Lossless compression makes a file smaller without discarding a single pixel of information. When the image is opened again, it is reconstructed exactly, byte-for-byte identical to the original. It works by finding patterns and redundancy (long runs of the same colour, repeated shapes) and describing them more efficiently. Think of it like folding a jumper neatly to fit a drawer: it takes less space, but nothing is lost and it unfolds perfectly.

PNG is the classic example of lossless image compression, and WebP has a lossless mode too. Because nothing is thrown away, lossless is the right choice whenever accuracy matters. The trade-off is modest savings on complex, photographic content, where there is little repetition to exploit.

What lossy compression means

Lossy compression achieves much smaller files by permanently discarding detail your eyes are unlikely to notice: subtle colour shifts, fine gradients, high-frequency texture. JPEG is the best-known lossy format, and WebP's lossy mode works similarly. Push it gently and the image looks identical while weighing a fraction as much. Push it too hard and you start to see blocky artefacts, banding in skies, and haloes around sharp edges. Crucially, once that detail is gone, it cannot be recovered by re-saving.

Why a lossless copy of a JPEG can be LARGER than the original

This surprises almost everyone. If you take a JPEG photo and re-save it as a lossless PNG or lossless WebP, the new file is often bigger than the JPEG you started with. Why? Your JPEG is already lossy: it has already thrown away a great deal of data to become small. A lossless format has to faithfully preserve every pixel of that already-compressed image, including the tiny compression artefacts JPEG introduced. It has no licence to discard anything, so it cannot beat a format that was allowed to. The lesson: converting a photo to a lossless format rarely saves space, and often costs it. For photographs, staying lossy is almost always the smarter route.

When to choose each

The right choice depends on what the image actually contains. Use the table below as a quick guide.

Image typeBest modeWhy
PhotographsLossyHuge size savings with no visible loss
Logos & iconsLosslessFlat colours and sharp edges must stay crisp
ScreenshotsLosslessText and UI lines blur badly under lossy
Illustrations / flat artLosslessFew colours compress well without loss
Editing masters / archivesLosslessPreserve every pixel for future edits
Web hero & gallery photosLossySpeed matters more than absolute fidelity

A quick decision checklist

  1. Does the image contain text, sharp lines or flat colour blocks? Lean lossless.
  2. Is it a photograph with smooth gradients and lots of detail? Lean lossy.
  3. Will you edit or re-export it repeatedly? Keep a lossless master.
  4. Is raw page-speed the priority for a web photo? Choose lossy.
  5. Not sure? Export both and compare the file sizes (the point below).

How our tool shows you both

You do not have to memorise any of this or guess in advance. For every image you drop in, our compressor produces a lossless version and a lossy version (quality 80) and displays both file sizes next to each other. You simply pick the one that gives the best balance for that specific picture. It is the fastest way to settle the lossless vs lossy compression question in real terms, on your own files, rather than in the abstract. Because everything runs in your browser using the real libwebp encoder, your images never leave your device: no uploads, no sign-up, no watermarks, free forever and made in the UK.

The near-lossless middle ground

There is a useful option between the two extremes. Near-lossless compression keeps the image visually indistinguishable from the original while allowing a tiny, carefully controlled amount of data reduction, enough to shave off meaningful size without artefacts you could ever spot. It is a clever compromise for graphics that are almost, but not quite, worth full lossless treatment. WebP handles this territory particularly well, which is one reason it so often out-performs older formats. To see how the formats stack up overall, read our WebP vs JPG vs PNG comparison, or dig into the wider family in the image formats guide.

Putting it into practice

In short: reach for lossless when detail is sacred (graphics, screenshots, text and editing masters), and reach for lossy when you are publishing photographs to the web and size is what counts. Remember that re-encoding an existing JPEG to a lossless format usually backfires, so start from the highest-quality original you have. When you are ready, open the compressor and let it show you both outputs, or head straight to compressing PNG graphics or compressing JPG photos depending on what you are working with.

Related guides & tools