Images are usually the heaviest thing on a web page, which makes the format you choose one of the simplest levers you have for a faster, better ranking site. For years JPEG did almost all the heavy lifting. Now there are two newer formats, WebP and AVIF, that can deliver the same picture in a much smaller file. The question this guide answers is the practical one: in 2026, which should you actually use, and how do you serve it without leaving anyone with a broken image? The short version is that you use all three together. The longer version, below, explains why, and how to set it up properly.
What are AVIF, WebP and JPEG, and where did they come from?
Each format is really a different way of squeezing a picture into fewer bytes. JPEG arrived in 1992 and became the default for photographs because it compressed them well and every device could read it. Its age is also its limit: it cannot store transparency or animation, and its compression is dated by modern standards (MDN). WebP came from Google in 2010, borrowing the compression ideas behind a video codec to beat JPEG on size while adding transparency and animation. AVIF, introduced in 2019, goes further still: it is built on the AV1 video codec and tends to produce the smallest files of the three at a given visual quality (web.dev). The lineage matters because the newer the format, the more sophisticated the compression and the better the browser support needs to be before you rely on it.
AVIF vs WebP vs JPEG: the comparison at a glance
Here is how the three formats stack up across the things that matter when you are choosing what to put on a page.
| Factor | AVIF | WebP | JPEG |
|---|---|---|---|
| File size and compression | Smallest at a given quality | Smaller than JPEG | Largest of the three |
| Image quality | Excellent, strong at low file sizes | Very good | Good, but artefacts show when pushed |
| Browser and device support | Broad on modern browsers | Near universal on modern browsers | Universal, opens everywhere |
| Transparency | Yes | Yes | No |
| Animation | Yes | Yes | No |
| Best use | Hero photos, rich graphics, large images | General web images, safe modern default | Universal fallback, email, legacy support |
How much smaller are the modern formats, and do they look as good?
The headline benefit of WebP and AVIF is weight. At a comparable level of visual quality, WebP files are commonly meaningfully smaller than the equivalent JPEG, and AVIF files are usually smaller again, particularly on detailed photographic content. Google has published guidance and tooling showing AVIF achieving strong compression while preserving fine detail (web.dev). Exact savings vary with the image, the encoder and the quality setting, so it is wiser to test on your own pictures than to trust a single percentage. On quality, the newer formats also handle awkward content better. JPEG tends to show blocky artefacts and colour banding when you compress it hard, especially on gradients and flat areas. AVIF and WebP hold those regions together at lower file sizes, which is why a heavily optimised AVIF can look cleaner than a JPEG of the same weight rather than merely lighter. The practical takeaway is that switching format often lets you cut page weight without anyone noticing a drop in how the image looks.
What is the browser and device support like in 2026?
Support is the reason you cannot simply switch everything to AVIF and walk away. JPEG is the one format that is genuinely universal: it opens on every browser, phone, email client and design tool you are likely to meet. WebP is now supported across all current major browsers and has been for years, which makes it a very safe modern default. AVIF support has grown steadily and is available in the current versions of the major browsers, though it arrived later and a small share of older devices and apps still cannot read it. You can check the live picture for any format on caniuse.com, and the format reference on MDN is worth a bookmark. The honest summary is that AVIF and WebP both have broad reach in 2026, but support is never one hundred per cent, which is exactly why a fallback is not optional.
What about transparency and animation?
This is where the newer formats quietly replace two older ones. JPEG cannot do transparency, so anything that needs to sit cleanly over a coloured background, a logo, an icon, a product cut-out, has traditionally been a PNG, which is large. Both WebP and AVIF support an alpha channel, so they can deliver a transparent image at a far smaller size than a PNG. The same goes for movement. Animated GIFs are famously heavy for what they show, and both WebP and AVIF can carry animation in a fraction of the bytes. So the modern formats are not only a lighter JPEG; they are also a lighter PNG and a lighter GIF, which means you can standardise more of your site on fewer, smaller files. If your pages still lean on big transparent PNGs or chunky GIFs, this is often where the easiest weight savings hide.
When should you use each format?
Rather than crowning a single winner, match the format to the job and always provide a fallback.
- Reach for AVIF on the heavy, important images: hero banners, large photographs, detailed graphics and anything where shaving kilobytes makes a visible difference to load time.
- Reach for WebP as your dependable modern default for general site imagery, and as the fallback that catches browsers that cannot read AVIF.
- Keep JPEG as the universal baseline for the rare older browser, and for places outside your site such as email and third-party tools where modern formats may not render.
- Skip JPEG entirely when you need transparency or animation, since it supports neither; use AVIF or WebP with a PNG or GIF fallback instead.
If you want the deeper case for going AVIF-first on a modern site, we cover it in our companion piece on AVIF as the future of web images, and the broader question of how image choices affect speed and rankings in free images versus paid images.
How do you actually serve modern formats with a fallback?
The whole strategy comes together in one piece of HTML: the picture element. You list your sources from best to most compatible, and the browser downloads the first one it understands. A typical layered setup offers AVIF, then WebP, then a JPEG inside a plain image tag as the final catch-all. Browsers that read AVIF take it, those that do not fall back to WebP, and anything older still gets the JPEG. The pattern looks like this:
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="A clear description" width="1200" height="800">
</picture>
Setting the width and height keeps the layout from jumping while the image loads, which protects your Cumulative Layout Shift score. The good news for most site owners is that you rarely write this by hand. Modern content management systems and image plugins generate AVIF and WebP versions on upload and build the picture markup for you, so your visitors get the best format automatically. If you only ever receive an AVIF file and need a copy that opens everywhere, you can convert AVIF to JPG in seconds. For a WordPress site specifically, getting this right is one part of a wider speed effort that we break down in our guide to WordPress speed optimisation. Whichever system you run, the principle is the same: keep one high-quality master image, let your tooling produce each delivery format from it, and serve them in order of best to safest.
Decided on AVIF and now need to work with the files? See how to open AVIF files in Photoshop for the version check and the two workarounds.
In short
Which image format should I use: AVIF, WebP or JPEG?
Key takeaways
- AVIF usually wins on file size at a given quality, WebP is the well-supported middle ground, and JPEG is the universal baseline that opens everywhere.
- AVIF and WebP both support transparency and animation. JPEG supports neither, which is why it cannot replace transparent PNGs or animated GIFs.
- Browser support for AVIF and WebP is now broad across modern browsers, but you still serve a JPEG fallback so nothing breaks on older devices.
- You do not choose a single format. A picture element offers AVIF, then WebP, then JPEG, and each browser downloads only the best one it can read.