AVIF vs WebP in 2026: sizes we measured, browser support, and the picture markup to ship both
First-hand: On 26 November 2026 we ran four public-domain NASA photographs through our own optimizer at its default settings and recorded the AVIF, WebP and JPEG sizes with the fidelity score of each AVIF; the picture markup below is what the tool emitted.
Short answer: for photographs on a website, encode AVIF and serve it first, with WebP as the second source and a JPEG as the fallback in the <img>. On the four photos we encoded today AVIF was 19–48 % smaller than WebP and 2.5 to 3.2 times smaller than JPEG at a quality that scores as visually transparent. Both formats are decoded by every current browser, so the old reason to hesitate over AVIF has gone; what remains is encode time (AVIF is slow to make, fast to show) and a handful of cases where it is not worth the extra file. For flat art such as logos and icons neither format is the answer: a traced SVG is smaller than both.
AVIF vs WebP size: four photos, measured today
We used our own optimizer (the same engine behind the browser tool and the API) at its defaults: AVIF quality 45 at encoder effort 4, WebP quality 75, and a mozjpeg JPEG for the fallback. The inputs are NASA photographs in the public domain. "PSNR" is the AVIF's fidelity against the source in decibels; above roughly 38 dB a photo is indistinguishable from the original at normal viewing sizes.
| Photo | Pixels | JPEG (fallback) | WebP | AVIF | AVIF fidelity | AVIF vs WebP | AVIF vs JPEG |
|---|---|---|---|---|---|---|---|
| Helix Nebula | 1280 × 1280 | 55,977 B | 23,672 B | 19,111 B | 44.6 dB | 19 % smaller | 2.9× smaller |
| Apollo 17 on the lunar surface | 1280 × 1279 | 80,386 B | 48,256 B | 25,210 B | 39.7 dB | 48 % smaller | 3.2× smaller |
| Crew photo, indoors | 1535 × 1920 | 248,147 B | 160,902 B | 98,003 B | 37.7 dB | 39 % smaller | 2.5× smaller |
| Earth's horizon from orbit | 1280 × 871 | 41,690 B | 24,634 B | 15,169 B | 42.2 dB | 38 % smaller | 2.7× smaller |
Two honest caveats. First, these are the tool's default qualities, chosen so each format lands in the visually transparent range, not qualities equalised to the same PSNR; part of the WebP-to-AVIF gap is that AVIF holds detail better at its setting. Second, the spread matters more than the average: the dark, noisy lunar photo gained the most from AVIF (48 %), the clean nebula the least (19 %). Flat, smooth photos compress well in every format; grain and texture are where AVIF earns its keep.
One more data point from our hero-image field test, because it surprised us: on a 1920-pixel storefront photograph, the WebP at our default came out larger than the mozjpeg JPEG (593,540 B against 541,938 B) while the AVIF was 277,438 B. WebP is not always smaller than a well-encoded JPEG; AVIF was, on every photo we have tried.
AVIF vs WebP browser support
Both are safe to serve to everyone today, provided you use <picture> so a browser that cannot decode one source falls through to the next. WebP has been in every major browser since Safari added it in 2020. AVIF followed in Chrome in 2020, Firefox in 2021, Safari in 2022 (macOS Ventura and iOS 16) and Edge in early 2024; a visitor on an older unsupported browser simply receives your WebP or JPEG. Check caniuse.com for the exact versions if your audience is unusual. Animated AVIF support arrived later than still images and is less uniform; for animations, test or keep a video.
AVIF vs WebP quality and compression
They are different generations of codec. WebP (2010) is built on the VP8 video codec; AVIF (2019) on AV1. AVIF supports higher bit depths, wide colour gamut and HDR, and its compression is better on photographic detail, gradients and noise, where WebP tends to smear. WebP is sharper at very low qualities in some comparisons and has a mature lossless mode; for a lossless image with transparency, WebP lossless is often the smaller file and the safer pick. For lossy photographs, which is most of a website's image weight, AVIF wins on size at equal appearance.
Encode time is the cost. AVIF took most of the two to seven seconds per photo our run spent on each image (three formats each), and a browser tab encodes slower than a server. Decoding is fast in every current browser, so visitors never pay for it; your build step or your optimizer does.
When AVIF is not worth it
- Flat art, logos, icons, charts. Trace them to SVG instead. In our logo field test the SVGs were a few hundred
bytes compressed where the AVIFs were several kilobytes.
- Tiny images. Below roughly 10 KB the format difference is a few hundred bytes; the request itself costs more than
the bytes. Spend the effort on your largest image, which is usually the hero.
- Lossless with transparency. Compare; WebP lossless or an optimised PNG is often smaller.
- Animated images. Animated AVIF support is uneven; a short muted
<video>is usually smaller and better supported. - A CDN already transforms your images. If a service re-encodes per request, it decides the format from the
browser's Accept header and your job is to give it a good source.
- A build that must finish in seconds. AVIF encode effort is tunable; our tool drops to a lower effort for the
smaller responsive variants for exactly this reason, at the cost of a few per cent in size.
The picture markup to ship both
This is what our tool emitted today for the crew photo with responsive widths on, with the file names shortened:
<picture>
<source type="image/avif" srcset="hero-640.avif 640w, hero-1024.avif 1024w, hero.avif 1535w" sizes="100vw">
<source type="image/webp" srcset="hero-640.webp 640w, hero-1024.webp 1024w, hero.webp 1535w" sizes="100vw">
<img src="hero.jpg" srcset="hero-640.jpg 640w, hero-1024.jpg 1024w, hero.jpg 1535w" sizes="100vw"
width="1535" height="1920" alt="Crew photo, indoors" fetchpriority="high" decoding="async">
</picture>
The order of the <source> elements is the preference order: the browser takes the first type it can decode. The <img> carries the JPEG for everything else and also the width, height and alt; width and height let the browser reserve the space before the file arrives (no layout shift), and fetchpriority="high" is for the one image at the top of the page only. For images below the fold the tool writes loading="lazy" instead and leaves fetchpriority out. The measured sizes for that photo's variants were AVIF 25,769 B at 640 px, 52,540 B at 1024 px and 98,003 B at full width, against 58,416 B, 119,912 B and 248,147 B for the JPEGs: a phone downloads the 640-pixel AVIF, a tenth of the original JPEG.
If you want a single <img> and no <picture>, serve WebP: it is the broadest single format that is still a real saving over JPEG. But the <picture> is six lines, and it is the only way to get AVIF's savings without stranding anyone.
Who should pick what
- A photo-heavy page, a hero image, product shots: AVIF first, WebP second, JPEG fallback, with
srcsetwidths. - Logos, icons, diagrams: SVG, not either format.
- One image, one tag, no fuss: WebP.
- You are unsure whether an image is "flat art" or "photo": the browser tool measures both routes and
keeps the smaller one that still looks right; nothing is uploaded. For many images, the API does the same per call with ?widths=auto for the responsive set — free for 250 operations a month with an account, then from $10 a month for 1,000 (checked 2026-11-26; plans).