Which Image Formats Are Lossless?
One table answers it for PNG, JPEG, WebP and AVIF, with which mode each encoder gives you by default.
| Format | Lossless, lossy, or both | Modes | What an encoder gives you by default |
|---|---|---|---|
| PNG | Lossless only | DEFLATE (zlib) | Always lossless |
| JPEG | Lossy, with a lossless mode in the standard | Sequential DCT (lossy), lossless mode | Lossy, which is what a normal .jpg file is |
| WebP | Both | VP8 (lossy), VP8L (lossless) | Lossy |
| AVIF | Both | AV1 lossy, AV1 lossless | Lossy, unless the encoder is told to go lossless |
Is PNG lossless?
Yes. PNG is lossless only. The W3C specification defines exactly one compression method, and it is DEFLATE, which restores the image bit for bit. The specification defines no lossy mode.
One thing people get wrong: a tool can reduce a PNG's colour palette before saving, so the file is smaller and the pixels differ from the original. The PNG itself is still lossless. The change happened before encoding. Converting a PNG to WebP or AVIF is also lossy work done outside the format, not a lossy PNG.
The internals are in How PNG Compression Works.
Is JPEG lossy or lossless?
A normal JPEG is lossy. That covers almost every photo saved as .jpg, which uses the sequential DCT-based mode and throws away information the eye is less likely to notice.
The JPEG standard itself does define a lossless mode. It is named in the standard as a separate mode of operation, and it is the one place where the answer to "is JPEG lossless" becomes yes. In practice it is rarely used, because a lossless JPEG is usually much larger than the lossy version and other formats handle that job better.
How the lossy side works is in How JPEG Compression Works.
Is WebP lossless?
It can be either. WebP has two modes: a lossy mode built on VP8, and a lossless mode called VP8L. A WebP file is one or the other, not a mix.
When you convert an image without choosing a mode, the common encoders produce lossy WebP. To get lossless output you have to ask for it, and the result will be larger. That trade is covered in the WebP Optimization Guide.
Is AVIF lossless?
It can be either. The AVIF specification allows both lossless and lossy coding and does not require one over the other.
What matters in practice is the encoder. The reference encoder, libavif, runs at a normal quality setting unless you pass its lossless option, so AVIF from your usual tools is lossy. Lossless AVIF is opt-in, and it is usually larger than the lossy version because it has to preserve every sample exactly.
The format internals are in How AVIF Compression Works.
Which format should you pick?
Pick PNG when the image must stay exact: logos, icons, screenshots with text, anything with transparent edges. Pick JPEG or lossy WebP for photographs where a small quality loss is acceptable. Pick AVIF or WebP when you want strong compression and the recipient's software can open it.
For the full difference between the two ideas, and where each format sits, read Lossy vs Lossless Compression. For a format-by-format comparison beyond this question, see WebP vs PNG vs JPEG.
Next Steps
Ready to compress something? Open the PNG compressor for a lossless result, or the JPEG compressor for photos. If you are unsure which mode to use on a JPEG, the JPEG quality settings guide walks through it.