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 browserImage 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
| JPEG | PNG | WebP | AVIF | |
|---|---|---|---|---|
| Compression | Lossy | Lossless | Both | Both |
| Transparency | No | Yes | Yes | Yes |
| Animation | No | No (APNG aside) | Yes | Yes |
| Relative size, photo | Baseline | 3–5× larger | 25–35% smaller | 40–50% smaller |
| Browser support | Universal | Universal | Every current browser | Every current browser |
| Outside the browser | Everywhere | Everywhere | Good, not universal | Still patchy |
| Encoding speed | Instant | Fast | Fast | Slow |
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
- Open the Image ConverterDrop in one image or a whole folder. Input can be JPG, PNG, WebP, AVIF, GIF, BMP, TIFF or SVG.
- Choose the output formatJPEG, PNG, WebP or AVIF. The list only ever offers what your browser can actually encode.
- Set quality, if the format is lossy80 is a good default. PNG ignores it, because there is nothing to trade away.
- Handle transparency if you are moving to JPEGPick the background colour that transparent pixels will be flattened onto.
- 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
- 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.
- 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
Tools in this guide
Keep reading
- How to compress images without losing qualityWhat image compression actually discards, which quality setting to use, and how to hit an exact file size in KB or MB — step by step, in your browser.
- Optimising images for a faster websiteImages are usually the heaviest thing on a page. A practical workflow for dimensions, format, quality and metadata — plus the HTML that stops layout shift.
- Which ImageDoctor tool should you use? A guide to all of themA plain-language map of every tool on ImageDoctor, what each one is for, and how browser-based tools compare with upload-based sites and desktop software.