The short answer
For images on a website, AVIF usually gives the smallest file at the same visual quality, and WebP is the safer, faster all-rounder. Both are modern formats with lossy and lossless modes, transparency and animation, and every current browser shows both. The differences are compression, encoding speed, high dynamic range and how many apps outside the browser open the file. Many sites serve AVIF first and WebP or JPG as the fallback.
Side by side
| AVIF | WebP | |
|---|---|---|
| Based on | AV1 video codec (AOMedia, 2019) | VP8 video codec (Google, 2010) |
| Compression | usually the smallest at equal quality | smaller than JPG and PNG, a bit larger than AVIF |
| Color depth | 8, 10 or 12 bits; HDR | 8 bits |
| Transparency | yes | yes |
| Animation | yes | yes |
| Encoding speed | slow | fast |
| Browsers | Chrome 85+, Firefox 93+, Safari 16.4+, Edge 121+ | all current browsers (Safari since 14) |
| Outside browsers | many editors and old apps do not open it | most editors open it; some old apps do not |
In published comparisons AVIF often saves another 20 to 30 percent over WebP at similar quality, but the gap depends on the image: photos with smooth gradients gain the most, small graphics with sharp edges the least. Test your own images: the image converter shows the size of each result next to the original.
When to choose AVIF
- Large photos and hero images, where every kilobyte delays the page.
- HDR or wide-gamut pictures, which WebP cannot hold.
- Images that are encoded once and served many times, so the slow encoding does not matter.
Convert with PNG to AVIF or JPG to AVIF, or any image with the AVIF converter.
When to choose WebP
- Images generated on the fly or in bulk, where AVIF's encoding time adds up.
- Files people will download and open in other programs.
- Small icons and UI graphics, where the size difference is tiny. See PNG to WebP.
Serving both
Use the <picture> element: the browser takes the first format it supports.
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="Description" width="1200" height="800">
</picture>Keep width and height on the <img> so the layout does not jump while it loads. For the basics of lossy and lossless compression, read lossy vs lossless.
FAQ
Is AVIF supported on iPhone?
Yes, Safari on iOS 16.4 and later shows AVIF, including animated AVIF. Older iPhones need a WebP or JPG fallback.
Is AVIF better than WebP for transparent images?
Both keep alpha. AVIF is usually smaller, WebP lossless is often better for flat graphics with few colors; compare both on your file.
Why is my AVIF bigger than the JPG?
The quality setting is too high, or the image is tiny or very simple. Lower the quality a few points and compare again.
Can I convert AVIF back to JPG?
Yes, with AVIF to JPG, but the result is a second lossy compression; keep the original source file when you can.