Quick verdict
Use AVIF for hero images and product photos where every byte matters. Use WebP as the universal default (97 % browser support). Use JPEG only when you need to support 10-year-old devices, attach images in email, or hand files to a non-technical user who'll panic at a .webp extension.
Use PNG for screenshots, logos, line art and anything needing transparency where AVIF/WebP lossless isn't supported by your editor.
How JPEG compression works
JPEG (1992) splits the image into 8 × 8 pixel blocks, converts each to YCbCr (separating brightness from colour), applies a Discrete Cosine Transform to encode frequencies, then quantises high-frequency coefficients more aggressively than low-frequency ones. Result: 10× smaller files than uncompressed BMP with imperceptible loss.
Strengths: universal support (every device since 1995), small CPU cost, great for natural photos. Weaknesses: visible blocking and ringing on text/UI, no alpha channel, no animation.
How WebP compression works
WebP (Google, 2010) uses block-based prediction (each block is predicted from its neighbours, only the residual is encoded). Lossy WebP is typically 25–35 % smaller than JPEG at the same visual quality. Lossless WebP rivals PNG at 26 % smaller.
Strengths: alpha channel, animation, lossy & lossless modes, near-universal browser support since 2020. Weaknesses: weaker support in older email clients and image editors; visible smudging on extreme low-bitrate text.
How AVIF compression works
AVIF (AV1 Image Format, 2019) is a still-image profile of the AV1 video codec. It uses larger 128 × 128 superblocks, more prediction modes, and arithmetic entropy coding. AVIF averages 50 % smaller than JPEG and 20 % smaller than WebP at the same visual quality.
Strengths: best-in-class compression, 10-bit and 12-bit colour, HDR, alpha, animation. Weaknesses: encoding is CPU-expensive (10–30× slower than JPEG), some image editors and Office apps still don't open them.
Real benchmarks on a 4000 × 3000 product photo
- JPEG q=85 → 1.8 MB
- JPEG q=75 → 1.1 MB
- WebP q=80 → 720 KB (40 % smaller than JPEG q=85)
- AVIF q=63 → 410 KB (77 % smaller than JPEG q=85)
- All four look visually identical at 100 % zoom on a 5K display.
Browser support in 2026
- JPEG: 100 %.
- WebP: 97.8 % (every browser since Safari 14 / Edge 18).
- AVIF: 94.2 % (Chrome 85+, Firefox 93+, Safari 16.4+, Samsung Internet 17+).
- Always serve a fallback via `<picture>` with `<source srcset>` so the 6 % on old browsers get JPEG.
Step-by-step: convert a folder of images for the web
- 1Audit your current images. Look for any JPEG above 500 KB or any PNG above 200 KB — those are the wins.
- 2Open the EazyAITools Image Converter. Upload up to 30 images at once.
- 3Pick output format (AVIF first, WebP as fallback) and target quality 75–80.
- 4Download the converted batch. Replace originals in your CMS or repository.
- 5Update your `<picture>` tags to serve both formats with JPEG fallback.
- 6Run Lighthouse and watch your LCP drop by 30–60 %.
The production-grade <picture> recipe
Wrap every image in `<picture>` with two `<source>` tags (AVIF then WebP) plus a JPG `<img>` fallback. Browsers pick the first format they support. This is the same pattern used by Apple, Google and Shopify.
Always set `width`, `height` and `loading="lazy"` on the `<img>` so Cumulative Layout Shift stays at zero and below-fold images skip the initial download.
When to keep using JPEG
- Email signatures (most clients still mangle WebP).
- PDF embeds (Acrobat handles JPEG natively, others not).
- Printer-bound files (RIPs vary in modern-format support).
- Legacy CMSes that re-encode anything non-JPEG.
FAQ
- Is AVIF worth the encoding cost?
- On hero images and product photos that get millions of impressions, absolutely. On low-traffic blog inline images, the CPU cost rarely pays back vs WebP.
- Will Google penalise me for serving WebP?
- No — Google created WebP. Lighthouse scores reward it. Search rankings reward fast pages, regardless of format.
- Does AVIF support transparency?
- Yes, with full alpha channel and better quality than WebP at the same byte budget.
- What about HEIC / HEIF?
- HEIC is Apple's iPhone photo format. Great compression, terrible web support. Convert to AVIF or WebP before publishing.
- How do I know which quality value to use?
- Start with 80 (JPEG/WebP) or 63 (AVIF). Compare A/B at 100 % crop. Drop 5 points if you can't tell the difference. Stop when artefacts appear.