---
title: "WebP and AVIF"
description: "Modern image formats that make photos much smaller than JPEG or PNG for a similar look. Chrome, Edge, Firefox, Opera and Safari show both."
url: https://ursy.com/wiki/webp-and-avif/
updated: 2026-11-26T15:48:12+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/webp-and-avif/
---

# WebP and AVIF

> Modern image formats that make photos much smaller than JPEG or PNG for a similar look. Chrome, Edge, Firefox, Opera and Safari show both.

**WebP and AVIF are modern image formats that make photos much smaller than JPEG or PNG for a similar look.** Both handle transparency and animation, and current versions of Chrome, Edge, Firefox, Opera and Safari show both. AVIF usually makes the smaller file; WebP also works in older Safari versions, from Safari 14. MDN shows the safe pattern: AVIF first, WebP second and a JPEG fallback last, all in one `<picture>` element.

## What are WebP and AVIF? {#what-are-webp-and-avif}

They are file formats for pictures, like JPEG and PNG, but with better compression. [MDN’s image format guide](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types) lists WebP as `image/webp` with the `.webp` extension, and AVIF as `image/avif` with `.avif`. Both can be lossy, which drops detail you will not notice, or lossless, which keeps every pixel. AVIF also supports HDR and wide colour, for pictures with stronger contrast and a bigger range of colours. Both are free to use: WebP needs no licence, and AVIF is royalty-free.

## How much smaller are they? {#how-much-smaller-are-they}

MDN gives the numbers:

| Format | Compared with | Typical saving (MDN) |
| --- | --- | --- |
| Lossy WebP | JPEG of similar quality | 25 to 35% smaller on average |
| Lossless WebP | PNG | About 26% smaller |
| Lossy AVIF | JPEG of similar quality | Around 50% smaller |

Your own savings depend on the picture, so measure before and after. For screenshots, diagrams and line art, MDN suggests lossless encoding such as PNG.

## Why does it matter for search? {#why-does-it-matter-for-search}

Pictures are often the heaviest part of a page, and smaller files load faster. That helps [page speed](https://ursy.com/wiki/page-speed/) and [Largest Contentful Paint (LCP)](https://ursy.com/wiki/largest-contentful-paint/). [web.dev says](https://web.dev/articles/lcp) a good LCP is 2.5 seconds or less, measured at the 75th percentile of page loads. An `<img>` element is one of the element types LCP looks at, so on many pages the main photo is the LCP. Image weight is a [technical SEO](https://ursy.com/wiki/technical-seo/) job as much as a design one. LCP is one of the [Core Web Vitals](https://ursy.com/wiki/core-web-vitals/). [Google](https://ursy.com/wiki/google/) Search supports both formats: its [image guide](https://developers.google.com/search/docs/appearance/google-images) lists “BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF”. See [image SEO](https://ursy.com/wiki/image-seo/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

[Multimodal AI](https://ursy.com/wiki/multimodal-ai/) tools read pictures as well as text, and [AI crawlers](https://ursy.com/wiki/ai-crawler/) fetch image files like any other request. A smaller file is quicker for every visitor, person or machine. What helps an AI tool understand a picture is the same as for Google: a real `<img>` element, a descriptive file name and good [alt text](https://ursy.com/wiki/alt-text/). Google says it does not index [CSS](https://ursy.com/wiki/css/) background images. An [image sitemap](https://ursy.com/wiki/image-sitemap/), an extension of your [XML sitemap](https://ursy.com/wiki/xml-sitemap/), helps Google find pictures it might miss. The format makes the file smaller; it does not describe the picture.

## How does the fallback work? {#how-does-the-fallback-work}

MDN shows the pattern:

```
<picture>
  <source srcset="photo.avif" type="image/avif" />
  <source srcset="photo.webp" type="image/webp" />
  <img src="photo.jpg" alt="photo" />
</picture>
```

The browser reads the sources in order. [MDN says](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/picture) that if it does not support a source’s `type`, it skips that source, and if nothing matches it uses the `<img>` address. The `<picture>` element holds zero or more `<source>` elements, followed by one `<img>`. So order matters: put the smallest format first. Google’s image guide also advises always keeping an `<img>` with a `src`, because some crawlers do not support `<picture>` or `srcset`.

## A worked example {#a-worked-example}

A bakery wants AVIF for its cake photos, with WebP and JPEG for older browsers. Its main photo is 800 by 600 pixels on screen, so it exports the photo at that size, not at the camera’s full width. It writes:

```
<picture>
  <source srcset="lemon-drizzle-cake.avif" type="image/avif" />
  <source srcset="lemon-drizzle-cake.webp" type="image/webp" />
  <img src="lemon-drizzle-cake.jpg" width="800" height="600"
       alt="Lemon drizzle cake on a wooden board" />
</picture>
```

The `<img>` carries the size and the alt text, so write real alt text there, not “photo”. MDN’s own example sets `width` and `height` on the `<img>` too. Google says alt text also helps people who use screen readers, which is part of [web accessibility](https://ursy.com/wiki/web-accessibility/). Because this photo is the first thing people see, the bakery does not lazy-load it.

## Which format, when? {#which-format-when}

| Picture | First choice | Fallback |
| --- | --- | --- |
| Photo on a page | AVIF | WebP, then JPEG |
| Picture with transparency | AVIF or WebP | PNG |
| Screenshot, diagram, line art | Lossless (PNG, or lossless WebP) | PNG |
| Short animation | Animated WebP or AVIF | GIF |
| Product picture in a Google feed | JPEG or WebP | PNG |

The last row matters for shops. Google’s Merchant Center [product data specification](https://support.google.com/merchants/answer/188494) accepts JPEG, WebP, PNG, non-animated GIF, BMP and TIFF for `image_link`. AVIF is not on that list. See [Google Merchant Center](https://ursy.com/wiki/google-merchant-center/), [shopping feed](https://ursy.com/wiki/shopping-feed/) and [ecommerce SEO](https://ursy.com/wiki/ecommerce-seo/).

## What are AVIF’s limits? {#what-are-avifs-limits}

AVIF is newer. MDN lists support from Chrome 85, Edge 121, Opera 71, Firefox 93 and Safari 16.1. Firefox shows animated AVIF from version 113. Because support “is not yet comprehensive”, MDN advises a fallback. AVIF also does not show progressively: MDN says files “must be fully downloaded before they can be displayed”. For small files that rarely matters. For very large pictures, it can. WebP on Safari for macOS needs Safari 14 or later and macOS Big Sur (11) or later.

## Common mistakes {#common-mistakes}

- Converting a photo that is far wider in pixels than it is ever shown. A smaller format does not fix a picture that is four times too big. Chrome’s [image delivery insight](https://developer.chrome.com/docs/performance/insights/image-delivery) says pages should not serve images larger than the size they render at.
- Serving AVIF on its own. Older Safari versions cannot show it, so always keep a WebP or JPEG fallback.
- Changing the file name to `.webp` without converting the file, so the `Content-Type` and the real format no longer match. Google also recommends that file extensions match the actual file type.
- Lazy-loading the main photo. [web.dev says](https://web.dev/articles/browser-level-image-lazy-loading) not to lazy-load images likely to be in the viewport when the page loads, especially LCP images. Use `loading="lazy"` only further down. See [lazy loading](https://ursy.com/wiki/lazy-loading/) and [above the fold](https://ursy.com/wiki/above-the-fold/).
- Using CSS background images for pictures that matter. Google does not index CSS images.
- Forgetting to clear the cache after replacing images, so visitors still get the old files. See [cache purge](https://ursy.com/wiki/cache-purge/).

## How to check it {#how-to-check-it}

1. Run the [Image SEO Checker](https://ursy.com/image-seo-checker/) on a page. It looks at alt text, AVIF or WebP, sizes and licence.
2. In Chrome DevTools, open the Network tab, filter by Img and read the Type and Size columns.
3. Check the server’s [HTTP](https://ursy.com/wiki/http/) `Content-Type` header for an image, such as `image/webp`. Our [HTTP Header Checker](https://ursy.com/http-header-checker/) shows it, and the [Edge Cache Checker](https://ursy.com/cache-checker/) shows whether the image is served from the [edge cache](https://ursy.com/wiki/edge-cache/) or your [origin server](https://ursy.com/wiki/origin-server/), often through a [CDN](https://ursy.com/wiki/cdn/).
4. Make new files with the [image converter](https://ursy.com/webmaster-tools/image-converter/), shrink them to the size they are shown with the [image resizer](https://ursy.com/webmaster-tools/image-resizer/), and compress them with the [image compressor](https://ursy.com/webmaster-tools/image-compressor/).
5. Before you publish, read what a file carries with the [image metadata viewer](https://ursy.com/webmaster-tools/image-metadata-viewer/), and strip location data from photos with the [EXIF remover](https://ursy.com/webmaster-tools/exif-remover/).
6. For AVIF, give a WebP or JPEG fallback with the `<picture>` element, and keep an `<img>` with a `src` for crawlers.
7. Run Lighthouse in Chrome; its image delivery insight flags images with unnecessarily large download sizes. Work out what your LCP figures mean with the [Core Web Vitals calculator](https://ursy.com/webmaster-tools/core-web-vitals-calculator/). Our [Page Speed Checker](https://ursy.com/page-speed-checker/) and real-user [Core Web Vitals Checker](https://ursy.com/core-web-vitals-checker/) are coming soon. See [why your website is slow](https://ursy.com/wiki/why-your-website-is-slow/).
8. For a whole page, run the [SEO Checker](https://ursy.com/seo-checker/). For shops, the [Product Page Checker](https://ursy.com/product-page-checker/) covers product images and [product structured data](https://ursy.com/wiki/product-structured-data/), and the [Product feed checker](https://ursy.com/product-feed-checker/) looks for merchant feed errors.
9. Check the picture shown when a page is shared with the [Open Graph checker](https://ursy.com/open-graph-checker/).
10. In URSY Pro, opening in stages: the [image SEO audit](https://ursy.com/pro/image-seo-audit/) covers alt text, sizes, formats and image sitemaps for every page, [real-user speed](https://ursy.com/pro/real-user-speed/) shows Core Web Vitals from your own visitors, and the [asset diet report](https://ursy.com/pro/asset-diet-report/) lists scripts and styles each page type loads but never uses.

## What URSY.com counts {#what-ursy-counts}

A request, in our counting, is one answer the website gave: a page, file, image, feed or API reply. We read requests from the CDN’s edge log, cache [hits](https://ursy.com/wiki/hit-analytics/) included, with the cache status of each. So you can see how often crawlers and people fetch your image files, and how many of those were served from cache. A [bot](https://ursy.com/wiki/bot-web-robot/) fetching the same image 10 times counts as 10 requests. The rules are on our [methodology](https://ursy.com/methodology/) page.

## Questions {#questions}

### Is AVIF better than WebP? {#is-avif-better-than-webp}

AVIF usually makes smaller files: MDN puts lossy AVIF at around 50% smaller than JPEG, and lossy WebP at 25 to 35%. WebP works in older Safari versions, and AVIF does not show progressively. Serve both, AVIF first.

### Does Google index WebP and AVIF images? {#does-google-index-webp-and-avif-images}

Yes. Google’s image guide lists both among the supported formats.

### Do I still need JPEG? {#do-i-still-need-jpeg}

Keep it as the fallback in the `<img>` element. MDN calls JPEG a good fallback for photographs.

### Can I use AVIF in Google Merchant Center? {#can-i-use-avif-in-google-merchant-center}

Not as `image_link`. Google’s accepted list is JPEG, WebP, PNG, non-animated GIF, BMP and TIFF.

### Will a smaller format fix a slow page? {#will-a-smaller-format-fix-a-slow-page}

It helps if images are the heavy part. A picture that is far too wide, a lazy-loaded main photo or a slow [time to first byte](https://ursy.com/wiki/time-to-first-byte/) each need their own fix.

## Related words {#related-words}

- [Largest Contentful Paint (LCP)](https://ursy.com/wiki/largest-contentful-paint/)
- [Lazy loading](https://ursy.com/wiki/lazy-loading/)
- [Alt text](https://ursy.com/wiki/alt-text/)
- [Image SEO](https://ursy.com/wiki/image-seo/)
- [Core Web Vitals](https://ursy.com/wiki/core-web-vitals/)
- [Page speed](https://ursy.com/wiki/page-speed/)
- [Cumulative Layout Shift](https://ursy.com/wiki/cumulative-layout-shift/)
- [HTML](https://ursy.com/wiki/html/)
- [Speed topics](https://ursy.com/wiki/topics/speed/)

## Sources {#sources}

- [MDN: Image file type and format guide](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types), checked 24 November 2026
- [MDN: <picture>: The Picture element, last modified 1 October 2026](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/picture), checked 24 November 2026
- [Google Search Central: Google image SEO guide](https://developers.google.com/search/docs/appearance/google-images), checked 24 November 2026
- [web.dev: Largest Contentful Paint (LCP)](https://web.dev/articles/lcp), checked 24 November 2026
- [web.dev: Browser-level image lazy loading](https://web.dev/articles/browser-level-image-lazy-loading), checked 24 November 2026
- [Chrome for Developers: Improve image delivery](https://developer.chrome.com/docs/performance/insights/image-delivery), checked 24 November 2026
- [Merchant Center Help: Product data specification](https://support.google.com/merchants/answer/188494), checked 24 November 2026
- [URSY.com: How we count (methodology)](https://ursy.com/methodology/), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
