Every article on WebP vs AVIF says AVIF is smaller. Ours does too, mostly. We encoded 12 typical web images, from photorealistic scenes to 3D renders to page screenshots, as JPEG, WebP and AVIF, matched them to the same visual quality and measured the bytes, the encode time and the decode time in Chrome. AVIF came out a median 20% smaller than WebP, and JPEG needed a median 37% more bytes than WebP. But on the three grainiest images AVIF needed more bytes than WebP, at the settings most tools use it took 7.6 times as long to encode, and on our own server that cost is why this site still serves WebP.
— Guide
WebP vs AVIF vs JPEG: we measured all three on 12 web images
File size at equal quality, encode time, decode time in Chrome and browser support, measured on photos, 3D renders and screenshots, and which format to use where.
File size of each image at the quality of WebP q85
| Image | Type | Lossless PNG | JPEG | WebP q85 | AVIF | AVIF vs WebP |
|---|---|---|---|---|---|---|
| Desk with laptop | Photorealistic | 1,341 KB | 102 KB (q82) | 75 KB | 50 KB (q60) | −33% |
| Crowd under lights | Photorealistic | 2,981 KB | 336 KB (q88) | 280 KB | 227 KB (q70) | −19% |
| Clinic website with photo | Photo and interface | 468 KB | 52 KB (q89) | 30 KB | 24 KB (q68) | −20% |
| Clay figure, hospital bed | 3D render | 2,454 KB | 77 KB (q77) | 56 KB | 28 KB (q49) | −51% |
| Clay figures, neon stage | 3D render | 3,433 KB | 185 KB (q87) | 122 KB | 97 KB (q65) | −20% |
| Clay figure, office | 3D render | 3,852 KB | 303 KB (q88) | 233 KB | 188 KB (q69) | −19% |
| Clay figure with headphones | 3D render, grainy | 3,869 KB | not reached | 419 KB | 491 KB (q75) | +17% |
| Robot, dark scene | 3D render, grainy | 3,504 KB | not reached | 391 KB | 459 KB (q75) | +17% |
| Living room | 3D render, grainy | 4,109 KB | not reached | 472 KB | 576 KB (q77) | +22% |
| Homepage | Screenshot | 47 KB | not reached | 22 KB | 15 KB (q58) | −31% |
| Prices page | Screenshot | 66 KB | not reached | 35 KB | 28 KB (q63) | −21% |
| Table in a guide | Screenshot | 112 KB | not reached | 65 KB | 45 KB (q45) | −30% |
Each image 1,600 px wide, encoded with sharp 0.35.5 (mozjpeg, libwebp 1.6.0, libaom 3.15.1) on 10 October 2026. JPEG and AVIF were interpolated to the SSIM that WebP reached at quality 85, so every row compares files that look equally good by that measure; the q in brackets is the setting that gets there. "Not reached": JPEG stayed below that quality even at q95.
Three formats in one paragraph
JPEG is the format every browser and every tool has read for decades. WebP is Google’s format, built on the VP8 video codec. AVIF is the image format of AV1, the video codec of the Alliance for Open Media. All three compress photos with loss; WebP and AVIF can also do lossless images, transparency and animation. The question for a website is which one gives the smallest file at the quality you would publish, what it costs to make, and whether every visitor can see it.
How we measured
We picked 12 images of the kinds that end up on business websites: two photorealistic scenes, one clinic website with a portrait photo, six 3D renders from our own article art and three screenshots of pages on this site. Every source was a lossless PNG resized to 1,600 px wide. We encoded each one with sharp, the image library behind Next.js and many other tools, as JPEG (mozjpeg) at eight quality settings from 50 to 95, WebP at the same eight, and AVIF at eleven from 30 to 80, with sharp’s defaults otherwise.
To compare at equal quality we measured SSIM, a standard similarity score, between each file and its source, and for each image took the score WebP reached at quality 85, the setting this site uses. We then read off how many bytes JPEG and AVIF needed to reach the same score. Encode times are wall-clock on an Intel Core i7-6700K. Decode times were measured in Chrome 142 with createImageBitmap, 12 rounds per file in rotating order after a warm-up round. None of our sources is a straight-from-camera photo; the photorealistic scenes are renders, which is why we report the image types separately.
File size at the same quality
At the quality we serve, AVIF was a median 20% smaller than WebP, and JPEG was a median 37% larger than WebP. The AVIF advantage was largest on screenshots (a median 30%) and on the simple, clean render of a figure in a hospital bed, which came out at half the size. On the photorealistic scenes it was 19 to 33%. JPEG was the largest file wherever it could reach WebP’s quality at all; on the screenshots and the grainy renders it could not, even at quality 95.
At a lower quality the gap widens. Matched to WebP at quality 75, the default of Next.js, AVIF was a median 27% smaller and JPEG a median 56% larger. Compared with the lossless PNG sources, the WebP files were about a twelfth of the size: 2.2 MB against 26 MB for all 12 images together.
Where AVIF loses: grain and fine noise
On three images AVIF needed more bytes than WebP, not fewer: 17% more on two of them and 22% more on the third. All three are renders with visible film grain, and they are the three noisiest images in the set by a simple measure of pixel-to-pixel detail, between 24 and 28 against 2 to 16 for the other nine. AVIF tends to smooth that kind of fine noise away, and keeping it costs bits. Because those three are also among the largest files, the 12 AVIF files together came out 1% larger than the 12 WebP files; without them, AVIF saved 24% in total.
So if your images are grainy photos or renders with deliberate texture, test them before switching. If they are clean product shots, illustrations or screenshots, AVIF will almost certainly be smaller.
Encoding: where AVIF’s cost is paid
With sharp’s default settings, AVIF took a median 7.6 times as long to encode as WebP: about a second per image here, against 0.15 seconds for WebP and 0.13 for JPEG. The ratio ranged from 3 to 15 times, and the slowest were the large, detailed images. Next.js encodes AVIF at a lower effort setting, effort 3 instead of sharp’s default 4; at effort 3, AVIF took 1.8 times as long as WebP, and the files were a median 4% larger at the same quality setting.
AVIF’s cost is paid when the image is encoded, so whether it matters depends on where that happens. In a build step or a CDN that encodes each image once and caches it, a second per image is nothing. On a server that encodes on the first request, the first visitor waits for it. We measured that on our own hosting before deciding: a 24-megapixel portfolio image took 40.07 seconds as AVIF against 2.57 seconds as WebP through the same Next.js optimiser, to save 17% of the bytes, and it kept one CPU busy the whole time. This site serves WebP for that reason.
Decoding in the browser: practically a tie
Decoding took about the same time for AVIF and WebP: AVIF was a median 3% slower, around 14 milliseconds for a 1,600-pixel image on a desktop, and JPEG was 20% faster than WebP. Slowing the CPU down fourfold in Chrome changed almost nothing, because Chrome decodes images off the main thread. The download is what counts: at the 1.6 Mbps that Lighthouse uses to simulate a mobile connection, the median AVIF file arrived 69 milliseconds sooner than its WebP version, and the smaller photorealistic scene 128 milliseconds sooner. That is the difference that shows up in Largest Contentful Paint when the image is the largest element on the page.
Browser support in 2026
Both formats are safe for almost every visitor. Can I Use puts global support at 96.74% for WebP and 95.35% for AVIF. AVIF has worked in Chrome since version 85, Firefox since 93, Safari on iPhone since iOS 16 and Edge since 121; Safari on the Mac lists it as partial, because it needs macOS Ventura or later and does not support AVIF’s noise synthesis. The few browsers left without either are the reason a fallback still makes sense: a picture element that offers AVIF first, then WebP, then JPEG, or an image service that picks the format from what the browser says it accepts.
Which format to use
Use AVIF where images are encoded once, ahead of time, and WebP where a server encodes them on demand. A static site, a build pipeline or an image CDN can afford AVIF’s encoding time and gets files a fifth smaller for it, with WebP as the fallback. A self-hosted optimiser on modest hardware, like ours, is better off with WebP, which is already about a quarter smaller than JPEG. Keep JPEG as the last fallback only. Whatever you choose, it matters less than serving images at the right size: a 1,600-pixel image where 800 would do costs more than any format change saves.
For quality settings, the matches in our test were WebP 85 ≈ AVIF 67 ≈ JPEG 87, and WebP 75 ≈ AVIF 50 ≈ JPEG 77. Next.js turns its quality setting into an AVIF quality by multiplying it by 0.625, so 85 becomes 53; by our measure that is noticeably below its WebP at 85, so part of the saving you see is lower quality. Images and web fonts are the two parts of page weight a designer decides most directly. If you would rather have someone go through your images and the rest of the page weight with you, that is what our Speed Optimisation package does.
Sources and method
File sizes, quality scores and encode and decode times are our own measurements from 10 October 2026, described in the method section above. Browser support and the encoder settings come from the pages below.
- Can I use — AVIF image format ↗
Global support 95.35% (read 10 October 2026); Chrome 85, Firefox 93, iOS Safari 16, Edge 121; Safari on macOS partial (Ventura or later, no noise synthesis).
- Can I use — WebP image format ↗
Global support 96.74% (read 10 October 2026).
- Next.js — Image component: formats ↗
Default formats: WebP only; AVIF is opt-in. Next.js encodes AVIF at effort 3 and 0.625 times the requested quality (Next.js 16.3 source).
- sharp — Output options ↗
Default settings used here: WebP quality 80, effort 4; AVIF quality 50, effort 4, 4:4:4 chroma.
- Alliance for Open Media — AV1 Image File Format (AVIF) ↗
The AVIF specification.
- Google for Developers — WebP ↗
WebP is based on the VP8 video codec.
- Lighthouse — Network throttling ↗
Mobile simulation: 150 ms latency, 1.6 Mbps download.
- Wang, Bovik, Sheikh and Simoncelli — Image quality assessment: from error visibility to structural similarity ↗
The SSIM measure. We computed it on brightness in 8×8 windows every 4 pixels.
— FAQ
Frequently asked questions
Images slowing your pages down?
We measure what your images actually weigh, convert and resize them for each screen, and set up the format fallback that fits your hosting.