AVIF vs WebP vs JPEG: which image format should you use in 2026?
AVIF is smallest, WebP is the safe default, and JPEG still has a job. A practical guide to picking an image format for the web, with a copy-paste fallback snippet.

Every few months someone asks me the same question in a slightly different form: "Should I be using AVIF now?" or "Is WebP still worth it?" or "My designer exported everything as PNG, is that bad?"
The honest answer is boring: it depends on what's in the picture and where it's going. But the decision is a lot simpler than the internet makes it sound. Here's how I actually choose.
The short version
If you only read one section, read this one:
- Photos on a website: AVIF, with WebP as a fallback.
- One format only, no fallbacks: WebP.
- Screenshots, UI, diagrams, anything with sharp text: lossless WebP or PNG.
- Logos and icons: SVG.
- Email newsletters, upload forms, printing, sending to people who'll open it in random apps: JPEG.
Now the reasons.
JPEG: old, universal, still fine
JPEG is from 1992. It's older than a lot of the people reading this, and it's still the only image format you can send to absolutely anyone and know it'll open.
That's its whole advantage. Compression-wise, it's the weakest of the three. You get visible blocky artefacts and colour smearing as soon as you push quality down.
That said, not all JPEGs are equal. The encoder matters a lot. MozJPEG, an encoder Mozilla released in 2014, produces files roughly 10% smaller than the standard libjpeg at the same visual quality, and the output is still a completely normal JPEG that opens everywhere. If you have to ship JPEG, ship MozJPEG. That's what TinyRes uses when you pick JPEG.
Use JPEG when the file is leaving the web: email attachments, upload forms that only take JPG, print shops, or people who'll open it in old software.
WebP: the safe modern default
Google released WebP in 2010. For years it had an awkward problem: Safari didn't support it. That ended in 2020 with Safari 14, and today every browser that matters displays WebP.
In Google's own tests, lossy WebP files came out 25–34% smaller than JPEGs of similar quality, and lossless WebP about 26% smaller than PNG. In my experience, that holds up for typical website photos.
What I like about WebP is that it's boring in a good way:
- It encodes fast, so it's easy to use in build pipelines.
- It does both lossy and lossless, with transparency.
- It supports animation, which makes it a far better GIF replacement than GIF.
- Every CMS, CDN and image library handles it now. WordPress has accepted WebP uploads since version 5.8.
The weakness: lossy WebP always stores colour at reduced resolution. On photos you'll never notice. On images with thin, brightly coloured text or lines, like a red label on a white background, you can sometimes see a soft fringe. For those, use lossless WebP or PNG.
Use WebP when you want one modern format that works everywhere on the web with no fallback.
AVIF: smallest files, a few trade-offs
AVIF is built on AV1, the video codec used by Netflix and YouTube. It arrived in Chrome in 2020, Firefox in 2021, and Safari 16 in 2022. All current browsers support it.
For photos, AVIF is usually the smallest of the three by a clear margin. A quick rule of thumb: AVIF is often another 20–30% smaller than WebP at the same visual quality, and around half the size of a typical JPEG. On large hero images, that's the difference between a 400 KB file and a 150 KB one.
The trade-offs are real but manageable:
- It's slow to encode. Much slower than WebP or JPEG. That doesn't matter if you convert images once and serve them forever. It does matter if you're generating them on the fly for every request.
- At low quality it gets smooth rather than blocky. Where JPEG falls apart into squares, AVIF tends to smear fine texture like grass, skin pores or fabric into something a bit plastic. Don't push quality too low.
- No progressive loading. A large JPEG can show a blurry preview while it downloads. An AVIF appears all at once. With small files this hardly matters.
Use AVIF when you're serving photos on a website and want the smallest possible files.
What about JPEG XL?
JPEG XL is technically excellent. It's very efficient and can also losslessly repack existing JPEGs about 20% smaller. Safari supports it. Chrome removed its experimental support in 2023 and has since been working on bringing it back, but it's not something you can rely on in every browser yet.
TinyRes can output JPEG XL if you want to experiment. For production websites, treat it as a bonus format behind a fallback, not your main one.
How to serve AVIF with a fallback
You don't have to choose just one. The HTML <picture> element lets the browser pick the best format it understands:
<picture>
<source srcset="/img/hero.avif" type="image/avif" />
<source srcset="/img/hero.webp" type="image/webp" />
<img src="/img/hero.jpg" alt="Team photo at the office" width="1600" height="900" />
</picture>
The browser goes top to bottom and uses the first format it supports. Every modern browser will take the AVIF. Anything older gets WebP or the JPEG. Keep the width and height on the <img>, because they stop the page from jumping around while the image loads.
The quality settings I start with
Quality numbers don't mean the same thing across formats, which confuses a lot of people. "Quality 50" in AVIF looks about as good as "quality 80" in JPEG.
My starting points:
| Format | Quality | What it's for |
|---|---|---|
| JPEG (MozJPEG) | 80–85 | Universal compatibility |
| WebP | 75–82 | Everyday web photos |
| AVIF | 45–60 | Smallest photos |
| WebP lossless | — | Screenshots, UI, graphics |
Then look at the result at the size it'll actually be displayed. If you can't see a difference, try going lower. If you can, go back up.
Making all three versions
Exporting each image three times by hand gets tedious. In TinyRes, drop your images in and pick a preset: Web optimised gives you WebP at quality 80, Maximum compression gives you AVIF at quality 50, and Classic JPEG gives you MozJPEG at 82. Change the format, apply again, and download. Tweaking settings on an image you've already added doesn't count against your daily limit, so you can compare formats side by side for free.
And if you just want to know whether your images are the reason your site is slow, start with our post on why unoptimized images slow down your website.
zero bytes stored
Shrink your images right now
Convert to AVIF, WebP or MozJPEG, crop around faces, strip EXIF and hit exact KB targets in your browser.