Images
The Best Image Format for the Web: WebP vs AVIF vs JPG vs PNG
Images are usually the heaviest thing on a web page, so the format you choose has a direct impact on load time and Core Web Vitals. Here is how WebP, AVIF, JPG, and PNG really compare.
Why image format matters for performance
On a typical website, images account for well over half of the total page weight. Serving them in an efficient format is one of the highest-impact, lowest-effort ways to speed up a site, improve Core Web Vitals, and reduce bandwidth costs. The right choice depends on what the image contains.
JPG: the reliable default for photos
JPG remains a sensible baseline for photographic content. It compresses complex, colour-rich images well and is supported by literally everything. Its weaknesses are the lack of transparency and visible artefacts at aggressive compression, but for hero images and product photos it is still perfectly usable.
PNG: for graphics, logos, and transparency
PNG is lossless and supports transparency, which makes it the right tool for logos, icons, screenshots, and anything with sharp edges or text. The downside is size: a photograph saved as PNG can be several times larger than the same image as JPG. Use PNG for graphics, not photos.
WebP: the modern all-rounder
WebP is a great modern default. It supports both lossy and lossless compression plus transparency and animation, and it typically produces files 25-35% smaller than JPG or PNG at equivalent quality. Every major browser supports it now, so for most sites WebP is the sweet spot between size and compatibility.
AVIF: maximum compression
AVIF, based on the AV1 video codec, usually beats even WebP on file size at the same quality and supports HDR and wide colour. Browser support is now broad, though encoding is slower and some older desktop tools cannot open AVIF. It is ideal when squeezing out every last byte matters and you can provide a fallback.
A simple decision guide
If you want a quick rule of thumb:
- Photographs: WebP first, AVIF for maximum savings, JPG as a universal fallback.
- Logos, icons, line art: SVG if it is vector, otherwise PNG or lossless WebP.
- Screenshots with text: PNG or lossless WebP to keep edges crisp.
- Need it to open in any old software: stick with JPG or PNG.