Format comparison
WebP vs AVIF: smaller files, or easier to make?
Checked against the sources on Sizes measured
Short answer
Both formats beat JPEG for web images, both keep transparency, and both animate. On this page's photo sample the AVIF was smaller than the WebP at slightly higher fidelity. The catch is on the making side: the Chromium build measured here encodes WebP from a web page but not AVIF, and AVIF support in browsers is more recent. Choose AVIF when you control the encoding and can serve a fallback; choose WebP when the image is made in the browser or must work with the widest set of tools.
Where AVIF pulls ahead
AVIF borrows its compression from AV1, a much newer codec than the VP8 behind lossy WebP, and in this page's measurement that showed: at roughly the same fidelity to the original, the AVIF file was smaller. AVIF also reaches further technically. Its specification covers 10- and 12-bit images, HDR and wide colour gamut, whereas lossy WebP stores 8-bit colour.
Those advantages matter most on large photographs and hero images, where a few tens of kilobytes per image add up across a page, and on HDR content: MDN describes WebP as storing 8-bit colour, while the AVIF specification covers HDR.
Where WebP is the safer pick
WebP has two practical strengths. The first is that it is easy to produce: the browser measured here wrote WebP straight from a canvas, so any web-based tool, including AltFTool's, can output it on the visitor's device. The same browser returned a PNG when asked for AVIF. The second is history: MDN lists WebP support across current Chrome, Edge, Firefox, Opera and Safari, while its AVIF entries start at versions such as Edge 121 and Safari 16.1.
WebP also has a true lossless mode, a separate codec in the same container, which suits screenshots and graphics that must stay exact. In the browser measured here, quality 1.0 selected it.
Using both on one site
You do not have to choose once for every visitor. MDN's guide recommends a fallback through the <picture> element. A common arrangement is an AVIF source, then a WebP source, then a JPEG or PNG in the <img> tag; each browser takes the first one it supports. The cost is producing and storing three files per image, which is worth it for a handful of large images and rarely for hundreds of small ones.
WebP or AVIF, by situation
| Situation | Choose | Reason |
|---|---|---|
| Large photo on a site you control | AVIF with WebP/JPEG fallback | Smallest file at similar fidelity in this measurement. |
| Image converted in the browser | WebP | The browser measured here encodes WebP but not AVIF from a page. |
| HDR or 10-bit photo | AVIF | WebP's lossy mode is 8-bit; AVIF carries HDR signalling. |
| Screenshot that must stay exact | WebP lossless (or PNG) | WebP's lossless codec is long established; quality 1.0 selects it in the browser measured. |
| Images for email or older apps | Neither: JPG or PNG | Support outside browsers is less predictable. |
| Animated sticker or loop | Either | Both define animation; WebP has the longer track record in tools. |
Measured example
| File | Bytes | Size | Fidelity to the original |
|---|---|---|---|
| Photo as WebP, quality 0.82 (browser canvas) | 71,574 | 69.9 KB | 36.5 dB |
| Photo as AVIF, libaom crf 17 (reference file) | 57,992 | 56.6 KB | did not decode |
| Canvas asked for AVIF (came back as image/png) | 1,275,225 | 1245 KB | identical pixels |
The WebP was 69.9 KB at 36.5 dB; the AVIF was 56.6 KB at 37.2 dB, 19% smaller and slightly closer to the original. The AVIF's encoder setting was picked in advance as the one whose fidelity landed nearest this WebP's, so the two files are compared at similar quality rather than at matching slider numbers.
The third row is the practical catch. Asked for AVIF, the same browser's canvas produced image/png, so the AVIF had to be made with libaom outside the site. One photo is one data point, and a synthetic one; treat the percentage as an illustration, not a rule.
photo.avif was made outside the site with FFmpeg 6.1.1 (Ubuntu 7:6.1.1-3ubuntu5) with libaom-av1 3.8.2: still picture, crf 17, cpu-used 4, one thread, yuv420p; picked as the crf whose PSNR, decoded and measured with FFmpeg, came nearest the WebP 0.82 encode of the same sample.
What this page does not claim
- The AVIF file on this page was made outside the site (libaom through FFmpeg) because the measured browser cannot encode AVIF; the WebP was made by the site's own encoder.
Questions
Is AVIF better than WebP?
For compression, usually: on this page's photo the AVIF was smaller at slightly higher fidelity. For convenience, WebP still wins, because more tools and browsers can create it. Many sites serve AVIF with a WebP or JPEG fallback.
Which one can I create in the browser?
WebP. The Chromium build measured here encoded WebP from a web page but returned a PNG when asked for AVIF, so browser-based converters such as AltFTool's offer AVIF output only where the browser has an encoder.
Can I convert WebP to AVIF in the browser?
Only if your browser has an AVIF encoder. AltFTool's Image Converter checks this and disables the AVIF output when the browser cannot produce it.
Which one should I use for HDR photos?
AVIF. Its specification covers HDR and wide colour gamut at 10 and 12 bits, while MDN describes lossy WebP as 8-bit colour.
Which is better for animation?
Both support it: WebP through ANIM and ANMF chunks, AVIF through AV1 image sequences. MDN lists animated AVIF in Firefox from version 113.
Sources
- IETF, November 2024RFC 9649: WebP Image FormatInformational RFC · opened 13 November 2026
- Alliance for Open Media (AOMediaCodec/av1-avif on GitHub), 16 October 2025AV1 Image File Format (AVIF) v1.2.0, specification source (index.bs)Specification source; its metadata block gives Status: FD · opened 13 November 2026
- MDN Web Docs, 5 November 2026Image file type and format guideReference guide (page last modified 5 November 2026) · opened 13 November 2026
Convert between them in your browser
Make WebP in any browser, and AVIF where the browser can encode it. The Image Converter runs in your browser tab, with no account.