Skip to content
ImageDoctor
Comparison8 min read

JPG vs PNG vs WebP vs AVIF: which image format should you use?

Four formats, one decision, and a lot of bad advice online. Here is what each one is actually for, what happens to transparency when you convert, and the two rules that cover almost every case.

Processed locally in your browser

Image formats are one of those topics where everyone has a strong opinion and most of them are ten years out of date. The honest summary in 2026 is short: use WebP for almost everything on the web, JPEG when something outside your control has to read the file, and PNG only when you genuinely need lossless. AVIF is better than all of them at compression and worth the extra encoding time for large photographs.

The rest of this article is why.

The four formats at a glance

JPEGPNGWebPAVIF
CompressionLossyLosslessBothBoth
TransparencyNoYesYesYes
AnimationNoNo (APNG aside)YesYes
Relative size, photoBaseline3–5× larger25–35% smaller40–50% smaller
Browser supportUniversalUniversalEvery current browserEvery current browser
Outside the browserEverywhereEverywhereGood, not universalStill patchy
Encoding speedInstantFastFastSlow

JPEG: still the safe default outside the web

JPEG is nearly thirty-five years old and utterly ubiquitous. Every camera, every phone, every printer, every ancient piece of enterprise software, every job application portal — all of them read JPEG. Nothing else on this list can say that.

It is lossy, it has no transparency, and its compression has been beaten twice over. But if you are attaching a photo to an email, uploading to a government form, or sending something to a print shop, JPEG is the format that will not cause a problem.

PNG: lossless, and heavier than you think

PNG stores exact pixels. Nothing is approximated, which makes it the right choice for logos, icons, diagrams, line art and anything with hard edges or flat colour — the cases where JPEG's blocky artefacts around sharp boundaries are immediately visible.

Where PNG goes wrong is photographs. A photo has millions of subtly different colours and no repeating structure, which is exactly what lossless compression cannot exploit. A PNG of a photograph is routinely three to five times the size of an equivalent-looking JPEG, and people send them constantly without realising.

The other common surprise: there is no quality slider for PNG, so "compressing" a PNG does nothing. Re-encoding an already optimised PNG can even make it slightly bigger. To shrink a PNG you must either reduce its dimensions or change format.

WebP: the one to actually use

WebP does everything PNG and JPEG do, in one format: lossy and lossless modes, transparency, animation. At matched visual quality it is typically 25–35% smaller than JPEG, and it routinely halves a PNG screenshot with no visible change at all.

Support is no longer a reason to hesitate. Every current browser reads WebP, and has for years. The remaining caveats are outside the browser: some older desktop software, some print workflows and some upload forms still refuse it. That is a reason to keep JPEG around for files you hand to other people, not a reason to serve JPEG on your own site.

AVIF: smallest files, slowest to make

AVIF is derived from the AV1 video codec and compresses better than anything else here — often 40–50% smaller than JPEG at the same perceived quality, and noticeably better at preserving smooth gradients without banding. For large photographic hero images it is the clear winner.

The cost is encoding time. Browsers cannot save AVIF on their own, so ImageDoctor encodes it with a built-in AVIF encoder. That works everywhere, but a large image takes seconds rather than milliseconds. For a handful of important images that is a fine trade; for a batch of two hundred, WebP is the pragmatic choice.

AVIF also struggles with very small images and with sharp-edged graphics, where the overhead of the format outweighs its cleverness. Check the result rather than assuming.

How to convert between them

  1. Open the Image ConverterDrop in one image or a whole folder. Input can be JPG, PNG, WebP, AVIF, GIF, BMP, TIFF or SVG.
  2. Choose the output formatJPEG, PNG, WebP or AVIF. The list only ever offers what your browser can actually encode.
  3. Set quality, if the format is lossy80 is a good default. PNG ignores it, because there is nothing to trade away.
  4. Handle transparency if you are moving to JPEGPick the background colour that transparent pixels will be flattened onto.
  5. DownloadA single file downloads directly; several come back as a ZIP.

Not sure what you have? Image Analyzer reports the format, dimensions, weight and whether the file actually uses transparency — which is often the deciding fact, and is not something you can tell by looking.

Two rules that cover almost everything

  1. If it is going on a website you control, use WebP. Use AVIF for the few large photographs where the extra saving is worth the encoding time.
  2. If you are handing the file to someone else, use JPEG — or PNG when it has transparency or crisp edges that must survive exactly.

One more thing worth knowing: converting between lossy formats re-compresses the image. JPEG → WebP → JPEG loses a little more each time, like photocopying a photocopy. Always convert from the highest-quality original you have, not from a file you already compressed.

Common questions

WebP for most images — it is fast to encode and supported everywhere. AVIF for large photographic images where the extra 15–20% saving justifies the slower encode. Both keep transparency.

Open the Image Converter, add the PNG, choose JPEG, and pick the background colour that any transparent areas should be flattened onto. Add several files to convert them all at once and get a ZIP back.

For photographs and screenshots, almost always — WebP keeps transparency and is typically half the size. For very small icons and simple line art the difference is negligible, and PNG's universal support may matter more.

ImageDoctor converts the first frame only; the animation is not preserved.

Tools in this guide

All guides