WebP vs AVIF comes down to a trade-off between file size and reach. AVIF is built on the AV1 video codec and, according to MDN, compresses better than WebP, while WebP, MDN says, is better supported in browsers. Google Search supports both formats for images. What changes is how small the files get, which browsers can open them and what you need to keep as a fallback.
If you run a shop, publish articles or prepare banners for ad slots, you face the same choice for every image: which format, at what quality, with what fallback. Image formats for SEO are less about a ranking trick and more about getting pictures processed correctly and loaded quickly. The wider picture on search-side image setup is in image SEO: optimize images for Google.
Which Format for Which Picture: A Decision Table
Start from the picture in front of you and not from the format's reputation. MDN's section on choosing an image format gives the clearest guidance, and the table puts it next to the situations a site owner actually meets.
Decision table by situation
| Your situation | What to do | Why |
|---|---|---|
| A product photograph or other continuous-tone image | Lossy AVIF or WebP, JPEG as the fallback | Discarded detail in photographs is harder to see |
| A screenshot or graphic with text | Lossless WebP or PNG | Blurring and coloured fringes around text are very visible |
| A logo, icon or diagram that exists as a vector | Keep SVG | It draws accurately at every size |
| An image with transparency | WebP or AVIF with alpha, PNG as the fallback | JPEG has no alpha channel |
| A short animation currently saved as GIF | Animated WebP or AVIF, GIF only if a fallback is needed | MDN suggests considering WebP, AVIF or APNG for animation sequences |
| A very large first-screen image on slow connections | Resize first, then weigh AVIF against WebP or JPEG | AVIF has no progressive rendering |
| A banner for an ad slot | Read the slot's accepted file types before choosing | Each slot sets its own conditions |
MDN's guidance in prose
For raster images, MDN says to prefer WebP or AVIF, which provide better compression than PNG, JPEG and GIF. If you must support browsers that do not handle WebP, AVIF or JPEG XL, use picture with a PNG or JPEG fallback. For screenshots, diagrams, logos and line art it prefers lossless encoding. Photographs and other continuous-tone images can tolerate lossy compression. For diagrams and charts that must be drawn accurately at different sizes, MDN says to use SVG, and to prioritize the SVG version of icons where possible.
What happens to alpha and frames
Converting a PNG with transparency to JPEG removes the alpha channel. Practical suggestion: keep transparent images in a format that preserves alpha, and test the result on both dark and light backgrounds. When replacing an animated GIF with an animated WebP or AVIF, check that frame order, timing and looping survive.
The big hero image problem
Because MDN says AVIF has no progressive rendering, a very large AVIF hero image shows nothing until it has fully downloaded. Practical suggestion: shrink such an image to the size it is displayed at before encoding, and consider whether a WebP or JPEG version of the first-screen picture suits it better. How to prioritise that picture is covered in LCP image fixes with fetchpriority and preload.
What the Two Formats Are Built to Do
WebP vs AVIF comes down to a trade-off between file size and reach. The facts here come from MDN's guide to image file types, with web.dev's course for the AVIF background.
WebP as MDN describes it
According to MDN's image file type guide (Opens in a new tab), WebP supports lossy compression through predictive coding based on the VP8 video codec and lossless compression that uses substitutions for repeating data. MDN says lossy WebP images are on average 25 to 35 percent smaller than JPEG images of visually similar compression levels, and lossless WebP images are typically 26 percent smaller than the same images in PNG format. WebP also supports animation, with looping.
AVIF as MDN and web.dev describe it
MDN describes AVIF as a royalty-free, open source format that encodes AV1 bitstreams in the HEIF container. Its page says lossy AVIF images can be around 50 percent smaller than JPEG images as an example, and gives a median figure of 50 percent compression for AVIF against 30 percent for WebP on the same set of JPG files. Alpha transparency, lossless mode and animation are on the feature list. The limitation MDN calls out is that AVIF does not support progressive rendering, so files have to be fully downloaded before they can be displayed.
The AVIF lesson on web.dev (Opens in a new tab) frames the format as aiming for GIF-like animation, PNG-like transparency and improved perceptual quality at file sizes smaller than JPEG or WebP. It cites Netflix's testing framework as showing significant reductions in file size, though the lesson prints no percentage or byte figure. It also notes that tooling is relatively limited and points to Squoosh for trying AVIF.
Questions the facts answer
| The question | What the sources say | What it changes in practice |
|---|---|---|
| Which gives smaller photographs? | MDN: AVIF offers slightly better compression; its example shows lossy AVIF around 50 percent smaller than JPEG, and lossy WebP 25 to 35 percent smaller on average | Try both on your own photographs before you commit |
| Which handles transparency and animation? | Both: WebP with looping animation, AVIF with alpha and animation | Either can replace PNG transparency and GIF motion |
| Which shows partial image data early? | MDN lists no such limit for WebP and says AVIF has no progressive rendering | Large AVIF files appear only after a full download |
| Which is easier to produce? | web.dev calls AVIF tooling relatively limited | Check that your converter supports the format before planning a batch |
The percentages come from MDN's text. Your own images will not necessarily match them, since savings depend on content, resolution and encoder settings. Test on your pictures before promising a figure to anyone.
What Google Search Supports for Images
Whether a search engine can process a file comes before any size argument. Google's image documentation answers directly.
The supported list
Google's image best practices documentation (Opens in a new tab) says Google Search supports images referenced in the src attribute of an img element in these formats: BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. Both WebP and AVIF are named, so neither blocks your pictures from appearing in image results.
Responsive images and the src fallback
The same page says web pages use the picture element or the srcset attribute of an img element to specify responsive images, and it recommends that you specify a fallback URL using the src attribute. That recommendation is the backbone of any move to newer formats. Put AVIF and WebP sources inside picture and keep a JPEG or PNG in the img src.
MDN shows the same pattern. Its example places SVG, WebP and PNG sources inside a picture element and closes with an img element that carries a GIF fallback, width, height and alt text.
File names, alt text and image sitemaps
Google advises short, descriptive file names and avoiding generic names such as image1.jpg or 1.jpg. It calls alt text the key attribute for providing more metadata about an image and asks for useful, information-rich text that uses keywords appropriately. It also says you can submit an image sitemap to point Google at images it might not otherwise discover. A format conversion should therefore carry file names and alt text across untouched. For the writing side, see article image alt text and stock image licensing.
Format and Ranking: Hope Versus Documentation
People search for "WebP SEO" expecting a ranking lever. The documentation describes two separate matters: whether Google can process the file, and how heavy the page is.
Support is documented, a ranking benefit is not
Google lists WebP and AVIF among supported formats. Its image documentation makes no statement that switching formats improves rankings. Treat format as a condition for Google being able to process the image, not as a ranking lever.
Weight is the practical issue
The same documentation says images can be the largest contributor to overall page size, which can make pages slow and expensive to load. Smaller files therefore matter, and measurement and thresholds are covered in the page speed and Core Web Vitals guide.
Turn the conversion into a maintenance pass
Practical suggestion: a conversion pass is a chance to fix more than format. Resize images to the dimensions they are actually shown at, strip metadata you do not need and fill in missing alt text while you are there. Done together, the pass fixes the page's remaining image problems along with the format.
Reach: Which Browsers Open Which Format
The second condition for using a format is that the visitor's browser can open it. Support details change over time, so check the source pages before you rely on them.
MDN's version list
MDN gives AVIF support as Chrome 85, Edge 121, Opera 71, Firefox 93 and Safari 16.1, and says support is not yet comprehensive and has little historical depth, so a fallback in WebP, JPEG or PNG should be provided. It adds that Firefox 113 and later support animated AVIF. For WebP, MDN lists all versions of Chrome, Edge, Firefox, Opera and Safari, while noting that on Safari for macOS support depends on both the Safari and macOS versions, needing Safari 14 or later and macOS Big Sur (11) or newer. It describes WebP support as broad but without deep historical support and recommends a JPEG or PNG fallback.
web.dev's timeline and warning
The web.dev AVIF lesson says AVIF is supported in Chrome and Opera since 2020, Firefox in 2021 and Safari in 2022. It states that support for GIF, PNG and JPEG has been guaranteed across all browsers for decades, warns that a browser which cannot parse a format will not show the image, and closes with the principle that you should not sacrifice a more resilient web for the sake of a more performant one.
Decision rule: a fallback travels with every new format
Decision rule: produce the JPEG or PNG fallback first, then place WebP and AVIF sources ahead of it in a picture element. The browser takes the first source it supports, and if it supports none, the img src loads. A visitor does not meet a blank image.
Ordering the sources
Practical suggestion: list AVIF first, WebP second and the JPEG or PNG fallback last in the img element. Give each source its type attribute, so the browser can skip a format it cannot decode without trying to download it.
A Conversion Workflow That Protects Quality
Batch conversion is easy to run and easy to get quietly wrong, so each step is written out.
Eight steps from original to published page
- Back up the original file and encode from the original.
- Resize to the largest size the image will be displayed at, then encode.
- Set quality by picture type: lossy for photographs, lossless for text and logos.
- Compare the output with the original on screen, on light and dark backgrounds.
- Test transparency and animation separately.
- Carry the alt text and the descriptive file name across.
- Wire in the fallback with picture and keep a populated src.
- If you use an image sitemap, update the new URLs.
The second lossy pass
Practical suggestion: re-encoding an already compressed JPEG as lossy WebP or AVIF applies lossy compression twice. Start from the high-quality original when you have it. When you do not, keep quality high, convert once and look closely at edges and gradients for damage.
Questions to put to a conversion tool
| Criterion | Question | Why it matters |
|---|---|---|
| Quality control | Can photographs and text graphics get different settings? | MDN prefers lossless for text and logos |
| Fallback output | Is a JPEG or PNG also produced? | Google recommends a src fallback |
| Metadata carry-over | Do alt text and file names follow the new file? | Google calls alt text the key attribute |
| Transparency and animation | Are alpha and frames preserved? | Falling back to JPEG removes transparency |
| Original retention | Is the source kept? | Lossy compression cannot be undone |
| Preview | Can output be compared before publishing? | Damage is caught by eye |
Manual or automatic?
Decision rule: a handful of images that rarely change can be converted by hand, which makes quality review easy. If new images arrive regularly, make conversion a step of the publishing process and set quality per picture type. Either way, adding new formats does not mean deleting the fallback.
A Yarn Shop's Three Image Groups
Example scenario: a yarn shop wants to move its product pages to newer formats. The pictures fall into three groups, and each group gets its own decision.
Wide shots of skeins, balls and samples
Wide photographs of skeins, balls and finished samples are continuous-tone images, which tolerate lossy compression. The shop picks AVIF or lossy WebP first and keeps JPEG as the fallback. After converting, it checks the soft colour transitions between dyed shades on screen against the originals, since gradients are where compression damage shows.
Macro shots of fibre and stitches
A macro shot of a plied strand is full of fine lines and small tonal changes. If quality is pushed too low, the fibre texture flattens and the detail a buyer wants to inspect disappears. These images get a higher quality setting and are checked at zoomed-in size. File-size savings should not cost the detail.
The shade card and the logo
A shade card with printed labels is a text-heavy graphic. MDN prefers lossless encoding for that kind of image, so the shop uses lossless WebP with a PNG fallback. The logo stays in SVG if a vector version exists.
Order of conversion
The shop converts the category pages with the highest traffic first, compares output with the originals, then moves on to detail images. Logos and charts come last, since vector ones may not need converting. At each step it confirms that alt text survived and the fallback opens.
Scenario summary table
| Image group | Format decision | Fallback | Post-conversion check |
|---|---|---|---|
| Skein and ball photographs | AVIF or lossy WebP | JPEG | Gradients between dyed shades |
| Fibre close-ups | High-quality WebP or AVIF | JPEG | Texture at zoomed size |
| Shade card and logo | SVG or lossless WebP | PNG | Letter edges and colour |
| Short pattern demonstration | Animated WebP | GIF | Frame count and looping |
What Loads First: First-Screen and Lazy Images
A format decision alone does not fix loading. If every image on a page gets the same priority, the gain from smaller files disappears.
The picture visitors see first
The largest image visible when the page opens drives loading performance. It should load early and with high priority instead of being deferred. If you use AVIF here, remember it must be fully downloaded before it shows.
Pictures further down the page
Images that appear on scroll can be loaded lazily. How lazy loading interacts with search is covered in lazy loading and SEO for images, iframes and scroll-loaded content. A lazily loaded image still needs its fallback, alt text and size information.
Banners and Ad Creatives
A banner prepared for an ad slot follows different rules from a page image. What decides it is the file types and weight limits the slot accepts.
The slot sets the accepted file types
Do not assume that a format you use on your pages is accepted in every ad slot. Before uploading, check the technical requirements of the slot for accepted file types and size limits. Each slot has its own conditions.
Weight and browser intervention
Very heavy ads can trigger browser-side intervention, which is a separate topic. For weight limits and banner optimisation, see Chrome's heavy ad intervention, the 4 MB limit and banner file weight. Practical suggestion: prepare the banner with a fallback format, measure its weight at the lowest acceptable quality and match its pixel size to the slot's display size.
Proving the Gain
To say a page got faster, compare the same page before and after under the same conditions.
Three measures
Google's documentation says images can be the largest contributor to page size, so total image weight is the first measure. The second is when the largest first-screen image appears, since the LCP image is central to loading performance. The third is whether pages still render correctly in browsers where the fallback applies.
Before-and-after record
| Check | Before | After | Note |
|---|---|---|---|
| Total image weight on the page | Record before converting | Same page, same conditions | The drop depends on the image type |
| First-screen image | Load time | Load time | AVIF needs a complete download |
| Fallback format | Older browser case | Older browser case | Image must not break |
| Alt text records | Page source | Page source | Nothing should go missing |
Figures are specific to your pages and tools, so record your own and use the same method for later conversions. Field data from real visitors and lab measurements are not the same thing, so read them separately.
Release Checklist
- Every image uses a format Google supports, WebP and AVIF included.
- Each img has a populated src and a reachable fallback.
- Pictures using picture or srcset list sources so the browser picks the first one it supports.
- File names are short and descriptive and alt text survived the conversion.
- Transparency and animation were tested after conversion.
- The first-screen image loads early and pictures further down load lazily.
- Any image sitemap lists the new URLs.
- Banner files meet the ad slot's format and weight conditions.
Wrong Turns to Avoid
Flattening a transparent PNG into a JPEG
JPEG has no alpha channel, so a logo with a see-through background acquires a solid box. Keep transparent images in WebP, AVIF or PNG and check them on light and dark backgrounds.
Re-encoding a compressed JPEG at lossy settings
The second lossy pass compounds damage that the first one already did. Return to the high-quality original where it exists.
Treating every ad slot alike
A format that works on your own pages is not automatically accepted in a slot. The slot's technical requirements decide.
Judging success by file size alone
MDN notes that AVIF compresses slightly better yet has narrower support and no progressive rendering. A smaller file that appears late, or not at all in an older browser, is not a win. Read field data and lab measurements separately.
Discarding the originals after conversion
Lossy compression cannot be undone. Keeping the source files lets you re-encode when a format, an encoder or the page design changes.
Frequently Asked Questions
What should the picture element look like for a product photo?
Google recommends a fallback URL in the src attribute of the img element, and MDN shows sources of different formats ahead of an img fallback. Practical suggestion: AVIF source first, WebP second, then an img whose src is the JPEG, each source carrying its type.
Do I need a fallback if my visitors use current browsers?
MDN advises a fallback for both formats because AVIF support is not comprehensive and WebP lacks deep historical support. Google recommends a fallback URL in src. Practical suggestion: keep the fallback unless you have checked every browser your visitors use.
Will changing formats move my image rankings?
Google's image documentation makes no such statement. Converting can reduce page weight, and lighter pages load faster, but no ranking result can be promised.
Should logos and screenshots be lossy?
MDN prefers lossless encoding for screenshots, diagrams, logos and line art because blur and coloured fringes around text and sharp edges are very visible. Logos that exist as vectors are better kept as SVG.
Can I replace animated GIFs with WebP or AVIF?
MDN suggests considering WebP, AVIF or APNG for animation sequences. Check frame timing and looping after conversion and keep a GIF fallback where the target browsers need one.
Can I upload a WebP or AVIF banner to any ad slot?
That depends on the slot's accepted file types. Check the technical requirements of the specific slot before uploading.
Conclusion
WebP and AVIF are formats Google Search supports, and both can shrink files compared with JPEG and PNG. The right choice follows the picture type, the need for transparency or animation and the visitor's browser. Put the new formats in a picture element with a JPEG or PNG fallback in src, use lossy encoding for photographs and lossless for text and logos, and load the first-screen image early and the rest lazily. Treat a format change as an effort toward speed and correct processing, not as a ranking guarantee.
If you are preparing a banner and want a place to run it, you can look through our ad spaces page and check each slot's file format and size conditions before you choose.
Post a comment
Please log in to leave a comment. Login