JPG, PNG, WebP and AVIF: which to use and why
Four formats, each genuinely better than the others at something. The useful question is not which is best, but which matches what you are storing.
Published 3 November 2026
There is no best image format, and anyone who names one is answering a different question from the one you asked. Each of these four is genuinely the right choice for something, and genuinely a poor choice for something else. What decides it is the kind of picture you have and where it is going.
| Format | Compression | Transparency | Best for | Main weakness |
|---|---|---|---|---|
| JPG / JPEG | Lossy | No | Photographs, scans, anything continuous-tone | Smudges around sharp edges and small text |
| PNG | Lossless | Yes | Screenshots, diagrams, logos, flat colour, text | Very large for photographs |
| WebP | Both | Yes | The web — smaller than JPG and PNG at similar quality | Rejected by some older software and print services |
| AVIF | Both | Yes | Smallest files at a given quality | Slow to encode; browsers read it but cannot write it |
The distinction that matters most
Forget the format names for a moment. Almost every image is one of two kinds, and that is what should decide the format:
Continuous-tone images — photographs, scans of photographs, anything where colour shifts gradually and no two adjacent pixels are quite the same. There is no repeating pattern to exploit, so lossless compression achieves very little. Throwing away detail the eye cannot resolve, on the other hand, works extremely well.
Flat-colour images — screenshots, logos, diagrams, charts, line art, text. Large areas of identical pixels, with hard edges between them. Lossless compression handles these brilliantly because there is so much repetition. Lossy compression handles them badly, because the mathematics that discards invisible detail in a photograph produces visible halos around a hard edge.
Get this right and the format follows. Get it wrong — a photograph as PNG, a screenshot as JPG — and no amount of adjusting quality settings will rescue it.
JPG: still the default for photographs
JPEG is from 1992 and remains the correct answer for photographic content. Universal support, no licensing questions, and compression specifically designed around the limits of human vision — it keeps brightness detail, which we are sensitive to, and discards colour detail, which we are not.
Its weakness is structural, not a matter of tuning. JPEG works on 8 × 8 pixel blocks, and a hard edge crossing a block boundary produces ringing — faint halos and smudging. On a photograph this is invisible. On black text against white, it is obvious, and it is why a JPG screenshot looks subtly dirty around the letters.
It also has no transparency. Save a PNG with a transparent background as JPG and those areas become solid — black if nothing fills them first, which is why tools paint white underneath.
Quality settings in practice: 90–100 for archival or when the image will be edited again; 75–85 for almost everything, where the loss is invisible at normal viewing size; below 60 only when a size limit forces it. Each save re-encodes, so repeatedly opening and saving a JPG degrades it a little each time.
PNG: lossless, and that cuts both ways
PNG stores every pixel exactly. For a screenshot that is precisely right — the text stays as crisp as it was, with no artefacts anywhere. It also carries a proper alpha channel, so a logo can have a genuinely transparent background rather than a white box.
For photographs it is close to the worst choice available. Its compression looks for repetition, and photographic noise has none, so a PNG of a photograph routinely runs five to ten times the size of a JPEG that nobody could distinguish from it.
This matters more than it sounds, because phone screenshots are PNG by default, and people assembling screenshots into documents often do not realise what it costs.
WebP: the sensible modern default for the web
WebP does both lossy and lossless, supports transparency and animation, and is typically 25–35% smaller than JPEG at comparable quality. Every current browser reads it. If an image is destined for a website, it is usually the right answer.
The friction is everything that is not a browser. Print shops and photo labs, older desktop viewers, some content management systems, older Office installations and plenty of upload forms still refuse it. That gap is why converting WebP back to JPG is such a common need — people save an image from a website, get a WebP, and find nothing will take it.
AVIF: smallest files, with a catch
AVIF is derived from the AV1 video codec and produces the smallest files of the four at a given visual quality, often meaningfully smaller than WebP. It handles transparency, animation and wide colour, and it degrades more gracefully at very low bitrates — an aggressively compressed AVIF tends to go soft rather than blocky.
Encoding is slow, which is fine for a build step and painful in an interactive tool. And there is a specific asymmetry worth understanding.
Reading a format is not the same as writing it
.avif, and hands you a file whose contents do not match its extension.This is not hypothetical. It is why Celveri’s converter offers JPEG, PNG and WebP as outputs but not AVIF, GIF or BMP: it probes what the browser can genuinely write by encoding a single test pixel and checking what came back, then disables whatever fails. Offering an option that produces a mislabelled file would be worse than not offering it.
Choosing, in one pass
- Photograph for a website — WebP, or AVIF if your build pipeline can produce it.
- Photograph for an upload form, print shop, or anything official — JPG. Universal acceptance beats file size.
- Screenshot, diagram, chart or logo — PNG, or lossless WebP if the destination definitely supports it.
- Anything needing transparency — PNG or WebP. Never JPG.
- Anything that will be edited again later — a lossless format, so repeated saves do not accumulate damage.
Two things that are not true
“Converting to a better format improves quality.” It cannot. Detail discarded by the first lossy encoder is gone; converting a JPG to PNG preserves exactly what the JPG had, including its artefacts, in a much larger file. Converting lossy to lossy adds a second round of loss on top of the first. The best any conversion achieves is not making things noticeably worse.
“Renaming the extension converts the file.” It does not. The bytes inside are unchanged and software reads the bytes, not the name. A WebP renamed to.jpg will still be refused by whatever refused it before, or display as a broken image. Real conversion means decoding the image and re-encoding it with a different encoder, which is what the Image Format Converter does — and it verifies the result really is the format you asked for before handing it over.
Tools that help with this
Image Format Converter
Convert between the image formats your browser can genuinely decode and encode.
Image Compressor
Reduce an image to a target file size such as 100 KB or 500 KB.
