AVIF vs WebP vs JPEG: Real Benchmark (2026)
Most image format comparisons online are wrong because they compare JPEG quality 75 against WebP quality 75 against AVIF quality 75. Those numbers are not the same thing. We did it the right way: matched perceptual quality across all three formats using SSIM, then measured file sizes. Here are the real numbers.
Table of Contents
Quick Answer
At equal perceptual quality (SSIM 0.98 vs. lossless source), AVIF is 27% smaller than JPEG and 29% smaller than WebP. WebP and JPEG perform almost identically at this quality level: WebP was 3% larger than JPEG in our 5-photo set. To convert your images to AVIF now, use our free browser-based tool at sammapix.com/tools/convert-to-avif (no upload, no signup).
Results first: the data table
The table below shows the smallest file size each format needed to reach SSIM 0.98 versus a lossless source. All three formats are compared at the same perceptual quality threshold, not at the same quality number. See the methodology section for the full procedure.
| Image | Dimensions | JPEG (MozJPEG) | WebP | AVIF |
|---|---|---|---|---|
| Photo (landscape) | 1448x905 | 211K | 220K | 148K |
| Sunset | 600x600 | 50K | 49K | 37K |
| Wide 16:9 | 1672x941 | 243K | 235K | 154K |
| Film / RAW look | 1448x905 | 276K | 294K | 236K |
| Warm portrait | 800x800 | 43K | 48K | 27K |
| TOTAL | 5 images | 823K | 846K | 602K |
All sizes are the file output at the exact SSIM threshold (see methodology). Smaller is better. AVIF wins on every single image in the set.
Want to convert your own images to AVIF? The SammaPix AVIF converter runs entirely in your browser. No upload. No account required.
Why comparing at the same quality number is wrong
This is the most important methodological point in the article, and most comparisons online get it wrong.
When you encode a JPEG at quality 80, you get a specific visual result. When you encode a WebP at quality 80, the number refers to a completely different internal parameter in a completely different codec. When you encode an AVIF at quality 80 (using the CRF or equivalent), the number maps to yet another perceptual model inside libavif or libaom.
Concretely: AVIF quality 80 produces images that look roughly similar to JPEG quality 90 or higher. If you compare "AVIF 80 vs JPEG 80 vs WebP 80," you are not comparing the same visual quality. You are comparing outputs that look very different from each other, and then measuring which file is smaller. That comparison is biased toward AVIF before you even start, because AVIF at quality 80 is encoding a much harder target than JPEG at quality 80.
The correct approach is to fix the visual quality target independently of the format, and then ask each encoder: what is the smallest file you can produce that meets this quality bar? We used SSIM as the quality metric and set the target at 0.98 (very high quality, close to indistinguishable from the source). Then we found the smallest file for each format that reaches that threshold.
This is the only fair way to compare codecs. It is also why our WebP vs. JPEG finding is more nuanced than what most guides claim.
Methodology (fully reproducible)
Source images
We used 5 real photographs covering a range of content types that behave differently under compression: a landscape shot, a saturated sunset, a wide cinematic 16:9 frame, a high-grain film-look RAW conversion, and a warm portrait. Diverse content gives a more honest average than using a single photo.
Each photo was decoded to a lossless PNG source first, so the starting point for all three encoders is identical and contains no prior compression artifacts.
Encoders
- JPEG: MozJPEG via sharp (libvips). MozJPEG is a more efficient JPEG encoder than the baseline libjpeg, making this a fair comparison against modern JPEG practice.
- WebP: libvips sharp WebP encoder (libwebp, lossy mode).
- AVIF: sharp AVIF encoder (libavif + libaom), speed 6 (balanced, not the slowest possible).
Quality matching procedure
For each format and each image, we ran a binary search over the quality parameter to find the lowest quality setting that produces SSIM at or above 0.98 when measured against the lossless PNG source. SSIM was computed with ffmpeg (libavfilter ssim filter). The file size reported is from that specific encode, with no further optimization applied.
SSIM 0.98 corresponds to what most viewers would call high quality with no visible artifacts. It is a demanding threshold, deliberately chosen to reflect real production use cases (hero images, product photography, portfolio images) rather than thumbnails.
Per-image breakdown
Landscape (1448x905): JPEG 211K, WebP 220K, AVIF 148K
A typical outdoor photo with sky, foliage, and mid-range detail. AVIF saves 30% over JPEG and 33% over WebP. WebP is 4% larger than JPEG here, a pattern we see again in the film-look image below. Both codecs struggle similarly with the high-frequency detail in the foliage at this quality threshold.
Sunset (600x600): JPEG 50K, WebP 49K, AVIF 37K
The only image where WebP edges out JPEG slightly (1K smaller). This is a lower-resolution image with large smooth gradient areas, exactly the type of content where WebP performs best. AVIF still beats both by 26% versus JPEG.
Wide 16:9 (1672x941): JPEG 243K, WebP 235K, AVIF 154K
The largest image by pixel count. WebP shows a small advantage over JPEG (3% smaller), while AVIF is 37% smaller than JPEG. This is a cinematic-style photograph with good lighting but significant fine detail across the full frame.
Film / RAW look (1448x905): JPEG 276K, WebP 294K, AVIF 236K
The hardest image in the set. This is a high-grain, high-contrast RAW conversion with visible film grain. Grain is essentially noise, and noise is the worst case for every codec because it cannot be predicted or smoothed without visibly damaging the image. All three formats produce much larger files here. Notably, WebP is 6.5% larger than JPEG on this image, confirming that WebP does not generically beat JPEG at high quality. AVIF still compresses 14% better than JPEG.
Warm portrait (800x800): JPEG 43K, WebP 48K, AVIF 27K
AVIF's biggest win in the set. This portrait has soft skin tones, warm colors, and relatively low high-frequency detail. AVIF is 37% smaller than JPEG and 44% smaller than WebP. WebP is 12% larger than JPEG here. Portraits with smooth skin texture are an area where AVIF's intra-prediction model outperforms both older codecs significantly.
Three headline findings
Finding 1
AVIF is 27% smaller than JPEG at equal visual quality.
Total across 5 images: AVIF 602K versus JPEG 823K. This 27% reduction applies at SSIM 0.98, a high-quality threshold appropriate for production images.
Finding 2
AVIF is 29% smaller than WebP.
Total across 5 images: AVIF 602K versus WebP 846K. The gap between AVIF and WebP is slightly larger than the gap between AVIF and JPEG.
Finding 3 (the honest nuance)
WebP is roughly tied with JPEG at high quality, and about 3% larger in our set.
This contradicts the common claim that "WebP is always 25-35% smaller than JPEG." That figure is accurate at medium quality (around SSIM 0.93 to 0.96) for typical web images. At SSIM 0.98, the WebP advantage largely disappears for complex, high-detail, or grainy images. The sunset image (smooth gradients, low resolution) is where WebP performs most like the commonly cited benchmarks. On 3 out of 5 images in our set, WebP was actually larger than JPEG.
Nuance: when WebP still makes sense
The results above do not mean WebP is useless. There are real scenarios where it remains the right choice.
Medium quality (SSIM below 0.96)
WebP's efficiency advantage over JPEG is real and meaningful at medium quality settings. If you are serving thumbnails, social sharing images, or any use case where file size matters more than maximum fidelity, WebP delivers genuine savings over JPEG. Our benchmark specifically targets the high-quality production use case, which is where the advantage narrows.
Encoding speed
AVIF encodes significantly slower than WebP or JPEG, even at speed 6 (a balanced setting). For static assets that are encoded once and cached, this does not matter. For on-the-fly image resizing at scale, AVIF's encode time is a real operational cost. WebP encodes faster than AVIF across the board.
Lossless and animated images
WebP supports lossless compression and animations. This benchmark covers only lossy still images. For animated graphics, WebP is generally the better choice over animated AVIF, which has limited tooling support as of 2026.
Browser support in 2026
A common objection to using AVIF in production has been browser support. As of 2026, that objection is largely resolved.
| Browser | AVIF support since | WebP support since |
|---|---|---|
| Chrome | 85 (Aug 2020) | 32 (Jan 2014) |
| Firefox | 93 (Sep 2021) | 65 (Jan 2019) |
| Edge | 121 (Jan 2024) | 18 (2018) |
| Safari | 16.4 (Mar 2023) | 14 (Sep 2020) |
| Samsung Internet | 14 (Apr 2021) | 4 (2016) |
Global AVIF support exceeds 92% as of mid-2026. Safari support started with Safari 16.4 on macOS Ventura and iOS 16.4 in March 2023, meaning users on older Apple devices do not have AVIF support. This is the main reason to maintain a fallback.
For more detail on the browser support landscape, see our dedicated article: Can I use WebP and AVIF? Browser support in 2026.
The right implementation pattern
Use the HTML picture element with AVIF as the primary source and JPEG as the fallback. The browser picks the first format it supports, so users on older Safari get JPEG and everyone else gets AVIF automatically.
<picture> <source srcset="photo.avif" type="image/avif" /> <source srcset="photo.webp" type="image/webp" /> <img src="photo.jpg" alt="Description" /> </picture>
Next.js, Astro, and most modern image optimization libraries handle this automatically when you set formats: ['image/avif', 'image/webp'] in your configuration. You do not need to manage the fallback manually.
Practical takeaway and tools
Based on the benchmark data, here is a direct recommendation for different use cases.
- New web projects: use AVIF with JPEG fallback. The 27% size reduction is meaningful for page speed, Core Web Vitals, and bandwidth costs. Browser support is sufficient to make it the default.
- High-volume on-the-fly encoding: WebP is a reasonable choice if AVIF encode time is a bottleneck. The file size difference is real but so is the CPU cost of AVIF at scale.
- Grainy or film-look images: AVIF still wins but by a smaller margin (14% over JPEG for the film-look image). If encode time matters, WebP or JPEG are reasonable alternatives here specifically.
- Existing JPEG-only pipelines: migrating to AVIF requires testing your encoding setup. The benchmark numbers are averages; individual images can vary. Always measure your actual images.
Free tool: no upload, no signup
Convert your images to AVIF now. Runs entirely in your browser.
If you have received an AVIF file and need to open or convert it, use the AVIF to JPG converter. Both tools are free, client-side only, and require no account.
For a broader look at format selection strategy, see our guide on the best image format for the web in 2026.
Related guides and tools
FAQ
Is AVIF smaller than WebP?
Yes, at equal perceptual quality. In our benchmark of 5 real photos matched at SSIM 0.98, AVIF was 29% smaller than WebP in total (602K vs 846K). The gap is consistent across all image types tested, from portraits to landscapes to high-grain film images.
Why not compare JPEG, WebP, and AVIF at the same quality number?
Because the quality number means something different in each codec. Quality 75 in JPEG, quality 75 in WebP, and quality 75 in AVIF produce files at different visual quality levels. Comparing them at the same number is comparing apples to oranges. The correct method is to match perceptual quality (we used SSIM 0.98) and then compare file sizes.
Does AVIF lose quality compared to JPEG?
No. In this benchmark all three formats were matched to SSIM 0.98 against a lossless source. AVIF achieves that perceptual quality target at a smaller file size, not at lower quality. The output quality is equivalent across all three formats by design.
Which browsers support AVIF in 2026?
AVIF is supported in Chrome 85+, Firefox 93+, Edge 121+, and Safari 16.4+. Global browser coverage exceeds 92%. The recommended approach is the HTML picture element with an AVIF source and a JPEG fallback, so users on older browsers (particularly pre-16.4 Safari) receive a JPEG automatically.
How can I convert images to AVIF for free?
SammaPix has a free browser-based AVIF converter at sammapix.com/tools/convert-to-avif. It uses a real WASM encoder and runs entirely in your browser. No image is uploaded to any server, and no account is required.
Is my image uploaded when I use SammaPix to convert to AVIF?
No. Both the convert-to-avif tool and the avif-to-jpg tool run entirely client-side in your browser. Your images never leave your device. No file is sent to any server.
When does WebP still make sense over AVIF?
WebP encodes much faster than AVIF, which matters for on-the-fly image processing at high volume. WebP also has a real size advantage over JPEG at medium quality settings (below SSIM 0.96), and it is the better choice for animated images due to broader tooling support. For static high-quality images served to modern browsers, AVIF is the better default.