Home / Fix guides / Speed and Core Web Vitals

How to serve images in next-gen formats (WebP and AVIF)

Next-gen formats such as WebP and AVIF store the same picture in a smaller file than JPEG or PNG, so pages load faster. To fix it, convert your images or switch on automatic conversion in your platform, CDN or image plugin.

Speed tests often say "Serve images in next-gen formats". It means your pages send visitors JPEG or PNG files when WebP or AVIF versions of the same pictures would be smaller. Visitors do not see a warning. They just wait a little longer, especially on phones and slow connections.

What the problem looks like

The picture on your page looks fine. The problem is the file behind it. A photo saved as hero.jpg or a logo saved as logo.png may be several times larger than needed, and a newer format could often shrink it with no visible loss in quality.

You will usually notice it in one of these ways:

  • A speed test lists images that could be served as WebP or AVIF, with an estimated saving.
  • Pages with many photos (shops, galleries, portfolios) feel slow on mobile data.
  • The largest element on the page, often a banner photo, appears late.

Why it matters

Images are usually the heaviest part of a page. Smaller files download sooner, and that helps the Core Web Vitals measure called Largest Contentful Paint, which is how quickly the biggest visible item appears. Google uses page experience as one of many signals, so faster pages can help in search, though it will not fix weak content on its own.

The bigger effect is on people. Visitors on slow connections give up on slow pages, and that costs enquiries and sales. Smaller images also use less of your visitors' mobile data and less of your hosting bandwidth.

Quick guide to the formats

FormatBest forNotes
JPEGPhotosOld, works everywhere, larger files
PNGLogos, screenshots with sharp edgesLarge for photos
WebPPhotos and graphics, including transparencySupported by all current major browsers
AVIFPhotosOften the smallest, supported by current major browsers, slower to create

For most small sites, WebP is the safe, simple choice. AVIF can save more, but it takes longer to generate and is worth it mainly if your platform does it for you.

How to check if your site has it

These free checks need no developer:

  1. Run your page through PageSpeed Insights (pagespeed.web.dev). Look in the diagnostics for wording about image formats or "Improve image delivery". The exact label changes between versions of the tool.
  2. Open your page in Chrome, press F12, go to the Network tab, tick the "Img" filter and reload. The Type column shows jpeg, png, webp or avif for each file.
  3. Right-click an image and open it in a new tab. If the address ends in .jpg or .png and nothing converts it, you are serving the old format. Note that some sites serve WebP from an address ending in .jpg, so trust the Network tab over the file name.

Test your busiest pages, not only the home page: product pages, blog posts and landing pages.

How to fix it

There are three general routes. Pick the one that matches how your site is built.

1. Let your platform or CDN convert images automatically. This is the easiest option and usually the best for non-developers. The service keeps your original file and sends WebP or AVIF to browsers that support it.

2. Use an image plugin or app. On content management systems, a plugin can convert uploads and existing images in bulk.

3. Convert the files yourself. Free tools such as Squoosh (squoosh.app) or the command line tool cwebp turn a JPEG or PNG into WebP. Upload the new file in place of the old one. This suits small sites with few images.

If you edit HTML by hand, you can offer a fallback so old browsers still work:

<picture>
  <source srcset="photo.avif" type="image/avif">
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="Describe the photo" width="1200" height="800">
</picture>

Common platforms

Menus and settings depend on your version, theme and plan, so treat these as where to look.

  • WordPress: recent versions let you upload WebP files directly, and AVIF from version 6.5. For converting existing images, well-known plugins include ShortPixel, Imagify, EWWW Image Optimizer and Smush. Look for a "WebP" or "next-gen format" option in the plugin settings. See the WordPress guide for more detail.
  • WooCommerce: it uses the same WordPress tools, so convert product images with a plugin, then check product and category pages.
  • Shopify: images served through Shopify's image system are generally delivered in a modern format to browsers that support it. If a test still flags images, check for images hard-coded in theme files or loaded from outside Shopify.
  • Wix and Squarespace: both usually handle formats for you. Flagged images are often ones you embedded from elsewhere or added through custom code.
  • Next.js: the next/image component serves WebP by default when the browser accepts it. AVIF can be added through the images.formats setting in next.config.js.
  • Cloudflare: paid plans offer image optimisation features such as Polish, which can convert images to WebP. Check which features your plan includes.

One caution: converting a huge 5000 pixel photo to WebP still leaves a huge file. Resize images to the size they are actually shown at too, as covered in images that are too large.

How to confirm the fix worked

  1. Clear your site cache and any CDN cache so old files are not served.
  2. Reload the page with the Network tab open and check that images now show webp or avif in the Type column.
  3. Compare the total image size shown at the bottom of the Network tab with before.
  4. Run PageSpeed Insights again and check that the image format item has gone or shrunk.
  5. Look at the page in a different browser and on your phone. Images should look sharp, with no missing pictures.

If an image looks blurry or has odd colours, re-export it at a higher quality setting.

How to stop it coming back

The problem returns when someone uploads a fresh 4 MB JPEG and nothing converts it. A few habits prevent that:

  • Keep automatic conversion switched on in your plugin, platform or CDN.
  • Give editors a simple rule: resize photos before upload, and do not upload PNG for photographs.
  • Set width and height on images so the layout stays stable, as explained in images missing dimensions.
  • Re-test your key pages every few months, and after a theme change or redesign.

If you want this checked on a schedule, week 35 of SiteMonday is the image optimisation pack, and week 4 covers speed and Core Web Vitals. SiteMonday finds and explains the problems in a ranked fix list. Making the changes is up to you or your developer.

Step by step for your platform

Questions

What is the difference between WebP and AVIF?

Both are modern image formats that give smaller files than JPEG or PNG. AVIF is often smaller still but slower to create, while WebP is simpler and works in all current major browsers.

Will WebP images work in every browser?

All current major browsers support WebP. Very old browsers may not, which is why hand-written pages can use a `<picture>` element with a JPEG fallback.

Will converting to WebP make my images look worse?

Not noticeably at sensible quality settings. If a picture looks soft or blotchy, export it again at a higher quality.

Do I need to delete my old JPEG and PNG files?

No. Keep the originals as a backup and as a fallback. Most tools and plugins store them alongside the converted versions.

Does fixing this improve my Google ranking?

It can help indirectly by making pages faster, which supports Core Web Vitals. It is one small signal among many, not a ranking switch.

Why does a speed test still flag images after I converted them?

Usually a cache is still serving old files, or some images come from another site or are set in theme code. Clear caches and check the Network tab to find which files are still JPEG or PNG.

Related problems