WebP vs AVIF vs JPG: which is best for your website?
Images are usually the heaviest part of a web page. Picking the right format can cut page weight dramatically and improve your Core Web Vitals scores.
The short answer
- AVIF for the smallest photos when you can spare a little extra encoding time.
- WebP as the safe, fast, all-round choice for photos and graphics with transparency.
- JPG when the image must work everywhere, including email and older apps.
- PNG for screenshots, diagrams and images that must be pixel-perfect.
- SVG for logos and icons. It is vector, so it’s tiny and sharp at any size.
How they compare
| Format | Typical size vs JPG | Transparency | Browser support |
|---|---|---|---|
| JPG | Baseline | No | Universal |
| PNG | Often much larger for photos | Yes | Universal |
| WebP | 27% smaller on average (20–36%) | Yes | All current browsers |
| AVIF | 40% smaller on average (36–50%) | Yes | All current browsers (Safari 16+) |
The WebP and AVIF figures are our own measurements: we encoded five public-domain test photos in each format and compared file sizes at the same visual quality, measured with SSIM. Comparing at the same quality number would be misleading, because quality 75 means something different in each format.
| Photo | WebP saving vs JPG | AVIF saving vs JPG |
|---|---|---|
| Astronaut | 22% | 38% |
| Coffee | 32% | 47% |
| Cat | 20% | 40% |
| Rocket | 36% | 50% |
| Hubble star field | 25% | 36% |
Smooth subjects (the coffee cup, the sky behind the rocket) saved the most; the busy star field saved the least. Results on your own images will vary, so try it. Our compressor shows the exact size of every result, and you can tap a thumbnail to compare quality side by side.
Don’t forget the dimensions
A perfectly compressed 4000-pixel photo is still far too big for a 800-pixel-wide blog column. Resize to roughly the largest size it will be displayed at (or twice that for sharp high-DPI screens), then compress.
Serving modern formats with a fallback
If you need to support very old browsers, use the HTML <picture> element: list an AVIF source, then WebP, then a JPG <img> as the fallback. Each browser downloads only the first format it supports.
Encoding speed
AVIF’s smaller files come at a cost: it takes noticeably longer to create than WebP or JPG, especially for large photos. That doesn’t matter for a handful of images, but for thousands of product photos WebP is the practical default. Viewing is fast in all three formats.