WebP vs AVIF: which format to choose
AVIF makes smaller files, WebP opens more doors. The right answer depends on where the image will be published, not on which format is newer.
The short answer
Both formats do the same job — a small file for the web — but AVIF is the more compact of the two and WebP is the more compatible. At the same visual quality, an AVIF file is usually 20 to 30% smaller than a WebP file. In exchange, AVIF takes longer to encode, is younger, and is still refused by more tools.
- Choose WebP when you need one format that works everywhere, encodes fast, and keeps transparency or animation.
- Choose AVIF when file size is the priority and the image is served to browsers, which all support it today.
- Serve both when you can: the browser downloads the one it understands, and nothing is lost.
How they compress
WebP comes from the VP8 video codec, extended by Google with a lossless mode, transparency and animation. It splits the image into blocks, predicts each block from its neighbours and stores only the difference, then compresses colour separately at a lower resolution.
AVIF comes from AV1, a newer and more efficient codec. It uses larger prediction units, a better model of how detail is perceived, and handles high dynamic range natively. The result is a smaller file at the same perceived quality, at the cost of much heavier encoding: compressing one photo in AVIF can take several times longer than in WebP.
Size in practice
| Content | JPG | WebP | AVIF |
|---|---|---|---|
| Photo, 1600 px wide | 100% | 65 to 75% | 50 to 60% |
| Photo with fine texture | 100% | 70 to 80% | 55 to 65% |
| Flat illustration | 100% | 40 to 60% | 35 to 55% |
| Logo with transparency | not usable | lossless, small | lossless, smaller |
Percentages are relative to the JPG version at comparable quality. They vary a lot with the content: a smooth gradient gains more than a noisy photo, and a text-heavy screenshot behaves differently again.
Compatibility
WebP has been supported by Chrome, Firefox, Safari and Edge since 2020, and by most image editors and CMS since. AVIF arrived in browsers between 2021 and 2023: every current version of Chrome, Firefox, Safari and Edge displays it, but older software, some email clients and a number of social schedulers still refuse it.
Practical consequence: a WebP file is safe to send, upload and publish almost anywhere. An AVIF file is safe on a modern website but risky in an email, a print workflow or an old CMS.
Transparency, animation and HDR
Both support transparency. WebP supports animation, which makes it the natural replacement for animated GIFs; AVIF can also carry animation, but support in browsers and tools is uneven, so it is rarely used for that today. AVIF supports high dynamic range and wide colour, which matters for photography but changes nothing for a typical web page.
Encoding speed and workflow
Encoding AVIF is slow, especially at high quality: a large photo can take seconds, and a batch of thirty noticeably longer. The tools on this site therefore encode AVIF when your browser can, and fall back to the server otherwise. WebP encodes in a fraction of the time, which is why it remains the default choice for a batch of images.
Serving both formats
A website can offer the same image in two formats and let the browser decide:
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="Description" width="1600" height="900">
</picture>
The browser takes the first format it supports and ignores the rest. The JPG at the end is only a fallback for very old browsers, so it can be saved at a lower quality than the others.
Which one to choose today
- A blog, a shop, a landing page: WebP is enough, and it is the safest single choice.
- A performance-sensitive site: AVIF for photos, WebP for everything else, JPG as a fallback.
- An email, a document, a print job: neither. Use JPG or PNG.
- An animated image: WebP, or GIF if the target software cannot read WebP.
Converting is free and reversible enough for a test: compress the same photo in both formats at comparable quality, compare them at 100%, and keep the one that looks identical. Tools: Convert to WebP, Convert to AVIF, Convert to AVIF and the JPG, PNG and WebP guide.