WebP and AVIF are modern image file formats that store photos and graphics at smaller file sizes than JPEG and PNG while looking much the same to the eye. Smaller images mean pages load faster, which helps visitors and supports good page speed scores.
How WebP and AVIF work
Both formats use more efficient compression than the formats they replace. WebP was released by Google in 2010 and handles lossy compression for photos, lossless compression for graphics, transparency and animation, so one format can stand in for JPEG, PNG and GIF. AVIF is newer, developed by the Alliance for Open Media from the AV1 video codec. For photographs it usually achieves smaller files again at the same visual quality, and it supports high dynamic range and wide colour, but it takes longer to encode.
All current major browsers display both formats. AVIF support arrived later, in Safari 16 in 2022 and in Edge at the start of 2024. For older devices, the HTML picture element lets you offer AVIF first, WebP second and JPEG as a fallback, with the browser choosing the first one it understands. Many content delivery networks can do the same automatically, converting images on the fly based on what each browser says it accepts.
WordPress has accepted WebP uploads since version 5.8 and AVIF since 6.5, provided the server’s image library supports them. Some hosts and plugins already convert uploads to WebP automatically, so check what your set-up does before adding another tool.
Why it matters
On most web pages, images make up a large share of the bytes downloaded, and the main hero image is often the element measured for Largest Contentful Paint. Cutting its size is one of the most direct ways to improve that metric. For visitors on a crowded commuter train or a rural 4G signal, the difference between a heavy JPEG and a well-compressed WebP is the difference between a page that appears and one they give up on.
Google Search indexes both formats, so switching does not cost you image search visibility, provided file names, alt text and surrounding content stay in place.
Common mistakes
- Converting without resizing. A 4,000-pixel-wide photo shown at 800 pixels is still far too heavy, whatever its format. Format and dimensions are separate problems.
- Squeezing quality too hard Which leaves blotchy skin tones and smeared detail on product photos, where accurate colour sells.
- Recompressing already-compressed files again and again, which compounds the damage. Convert from the best original you have.
- Using WebP in email newsletters Where some email clients still do not display it reliably.
- Serving WebP as the social share image Which some platforms and messaging apps handle poorly. A JPEG is the safer choice for the image shown when a page is shared.
- Applying lazy loading to the hero image after switching formats, which delays the very image the change was meant to speed up.
How to act on it
Run your key pages through PageSpeed Insights and look at the image delivery findings, which list images that could be smaller in a modern format or at a more suitable size. That shows you how much there is to gain before you change anything.
Then choose one pipeline and stick to it: conversion in the CMS, a plugin, or a CDN that converts automatically. Running two at once tends to produce double compression and confusing caches. Resize images to the largest size they are actually displayed at, use responsive srcset attributes so phones get smaller versions, and keep your original high-resolution files somewhere safe.
Format choice is one part of wider image optimisation, alongside dimensions, loading order and caching. Sorting out image delivery is a regular part of the technical SEO work I do on slow sites.
