JPG, PNG, WebP or AVIF: which one, and when
Four formats, one decision, and most of the advice about it is a list of features rather than a recommendation. The question that actually settles it is simpler than the comparison tables suggest: is this a picture of the world, or a picture of a screen?
Everything else — transparency, browser support, encoding cost — narrows the answer, but that first question eliminates half the options on its own.
The question that decides it
Photographs are continuous tone. Every pixel differs slightly from its neighbour, there are no hard edges, and there is far more detail than your eye can attend to. That is exactly the case lossy compression was designed for, and JPEG, WebP and AVIF all handle it well. PNG handles it appallingly.
Screenshots, logos, diagrams and text are flat colour with hard edges. There is very little detail, most of the image repeats, and every edge is high contrast — which is precisely where lossy compression puts its errors. PNG and lossless WebP store these exactly and compress them well. JPEG makes them look dirty while saving less than you would hope.
Get that right and the rest is detail. Get it wrong and no quality setting will rescue you: a photograph saved as PNG is a twenty-megabyte file that a two-hundred-kilobyte JPEG matches, and converting it is the single biggest saving available on this site.
What the sizes actually look like
Two images, encoded four ways at matched visible quality. A 12-megapixel phone photograph of a street, and a 1600-pixel-wide screenshot of a spreadsheet. Approximate, and the ratios hold up far better than the absolute numbers.
| Photograph | Screenshot | |
|---|---|---|
| PNG | 14 MB | 180 KB |
| JPEG at 85% | 1.4 MB | 310 KB, and visibly worse |
| WebP at 85% | 950 KB | 90 KB lossless |
| AVIF at 85% | 620 KB | 85 KB, slow to encode |
Read the two columns separately, because they tell opposite stories. On the photograph the order is exactly what you would expect and PNG is a disaster. On the screenshot JPEG is larger than PNG and looks worse doing it, which is the result that surprises people and the clearest illustration of why the content of the image decides the format.
Transparency
PNG, WebP and AVIF all store an alpha channel with 256 levels, so soft shadows and anti-aliased curves survive intact. JPEG has none. Convert an image with a transparent background to JPEG and the see-through areas are filled with a solid colour, white unless you choose otherwise, which is how a logo ends up in a white box on a coloured page.
This is worth checking before any conversion to JPEG, because the failure is invisible until the file is already in a document. If the transparency matters, WebP gives you both the alpha channel and a small file, which until it existed was a choice you had to make.
Support, honestly, in 2026
In a browser, all four work everywhere. WebP has been universal for years and AVIF is read by every current version of Chrome, Safari, Firefox and Edge. Browser support has not been a real argument against either for some time.
Outside a browser is where the differences still bite, and it is the part most comparisons skip. JPEG and PNG open in literally everything. WebP is refused by some older desktop editors, a few content systems and a surprising number of printers. AVIF is refused by considerably more, including older versions of Office, several email clients and a good deal of desktop software that has not been updated recently.
So the rule is not "use the newest format" but "match the format to where the file is going". On a web page, WebP or AVIF. Emailed to somebody, or uploaded to a system you do not control, JPEG. Archived, JPEG or whatever the camera produced.
The encoding cost nobody mentions
AVIF is markedly slower to produce than the other three — seconds per image rather than milliseconds — because it is built on the AV1 video codec and does a great deal more work to find those savings. For a handful of hero images that is irrelevant. For a library of five hundred product shots it is the difference between a task and an afternoon.
There is a second cost that is specific to doing this in a browser, and it is worth stating plainly because no other converter does. No browser can write an AVIF. Ask one for a file in that format and every current engine quietly hands back a PNG instead, with the wrong extension on it. So converting to AVIF here fetches a real encoder, libavif compiled to WebAssembly, about three and a half megabytes, and runs it on your machine. That is a wait once per visit — and your file still never leaves the device, which is the trade every other converter makes in the opposite direction.
The short version
- Photograph on a web page: WebP. AVIF if the images are the point.
- Photograph going anywhere else: JPEG, and stop worrying about it.
- Screenshot, logo, diagram, anything with text: PNG, or lossless WebP for the same thing a quarter smaller.
- Needs a transparent background: anything except JPEG.
- Archive or master copy: whatever it already is. Converting an archive to save space is how you find out in ten years which formats survived.
Questions
Which format should I use for a photograph on a web page?
WebP, unless the images are the whole point of the page, in which case AVIF. WebP is roughly a third smaller than JPEG at the same visible quality, every browser reads it, and it is a change you can make once and stop thinking about. AVIF is smaller again by twenty to thirty per cent but slower to produce, so it earns its place on a photography portfolio and rarely on a blog.
Is PNG better quality than JPG?
For the same image, PNG is exact and JPG is not, so in a narrow sense yes. In practice the question is wrong: PNG is better for pictures of a screen and much worse for photographs, where it produces enormous files that look no better than a JPEG a tenth of the size. Converting a JPG to PNG never improves it, because the detail was discarded before PNG ever saw the file.
Should I convert my whole photo library to AVIF?
No. Formats built for the web are for the web. JPEG will open in everything in twenty years, and AVIF today is refused by plenty of desktop editors, older operating systems and email clients. Convert copies for a website and keep the originals in the format the camera produced. An archive is exactly the place where universal support beats file size.
Does WebP support transparency?
Yes, with the same 256 levels PNG uses, in both its lossless and its lossy mode. That combination is the specific reason it replaced PNG for cut-out product shots and logos: until WebP, keeping a transparent background meant accepting a PNG-sized file. AVIF supports transparency too. JPEG has none at all and never will.
Related: convert an image, what compression throws away, and what a HEIC file is.