DailyConvertTools

Image Format Conversion: WebP vs AVIF vs JPEG Performance Guide

A practical workflow for converting website images to WebP and AVIF: which settings to use, how to serve them with a JPEG fallback, and how to check quality and speed afterwards.

Switching a website's photos from JPEG to WebP or AVIF is one of the easiest ways to make pages load faster. The images look the same, but the files are smaller, often much smaller. This guide is a practical workflow: which format to use, what settings to choose, how to serve the new formats safely and how to check the results.

The Formats in Brief

Format · Strengths · Weaknesses

JPEG · Works everywhere; fast to create · Larger files; no transparency

PNG · Lossless; transparency · Very large for photos

WebP · Smaller than JPEG and PNG; transparency and animation · Slightly less universal outside browsers

AVIF · Often the smallest files; HDR and wide colour · Slow to encode; some older software can't open it

Google's own tests found lossy WebP files around 25 to 34% smaller than JPEGs of similar quality, and lossless WebP around 26% smaller than PNG. AVIF is often smaller again, especially at lower quality settings. Actual savings vary from image to image, so test with your own photos.

Browser support: WebP works in all current major browsers. AVIF works in current versions of Chrome, Edge, Firefox and Safari (version 16 and later). Very old browsers need a JPEG or PNG fallback, which the code below provides.

Step 1: Start From Good Originals

Always convert from the best source you have: the original camera JPEG, a PNG or an exported master file. Converting an already heavily compressed image just preserves its existing flaws in a new format.

Resize first. If an image is displayed 800 pixels wide, there's no point serving a 4000-pixel file in any format. Our Image Resizer can do this.

Step 2: Choose Settings

WebP:

  • Photos: lossy, quality 75 to 85.
  • Logos, screenshots and graphics with text: lossless.
  • Transparency is supported in both modes.

AVIF:

  • Photos: AVIF's quality scale differs from JPEG's; a quality of around 50 to 65 in many tools looks similar to JPEG at 80 to 85. Compare visually rather than relying on the number.
  • Encoding speed: AVIF encoders have a speed or "effort" setting. Slower settings give smaller files but take much longer, which matters when converting thousands of images.

JPEG (fallback):

  • Quality 75 to 85 for photos.
  • Use an optimising encoder such as MozJPEG, which produces smaller files than standard encoders at the same quality.
  • Progressive JPEGs appear gradually as they load, which feels faster on slow connections.

Step 3: Convert

  • One-off images: our WebP converter and AVIF converter work in your browser, without uploading your images. Google's Squoosh is another good browser-based option for comparing settings side by side.
  • Desktop software: Photoshop, GIMP and Affinity Photo can export WebP; recent versions also support AVIF.
  • Batches and automation: command-line tools such as cwebp, avifenc and ImageMagick, or libraries such as Sharp for Node.js, can convert whole folders as part of a build process.
  • Automatically: many content management systems, plugins and image CDNs convert images to WebP or AVIF on the fly and send each browser the best format it supports.

Step 4: Serve the New Formats Safely

Use the <picture> element so each browser picks the best format it understands, falling back to JPEG:

<picture>
  <source srcset="photo.avif" type="image/avif">
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="Description of the photo" width="800" height="533" loading="lazy">
</picture>
  • width and height let the browser reserve space, preventing the page from jumping as images load.
  • loading="lazy" delays images further down the page until they're needed. Don't lazy-load the main image at the top of the page.

For different screen sizes, add srcset and sizes so phones download smaller files:

<img src="photo-800.jpg"
     srcset="photo-480.webp 480w, photo-800.webp 800w, photo-1200.webp 1200w"
     sizes="(max-width: 600px) 480px, 800px"
     alt="Description of the photo">

If you can't edit the HTML, a CDN or server rule can choose the format automatically based on the browser's Accept header.

Step 5: Check Quality and Speed

  • Look at the images. Compare them side by side at 100% zoom, especially skies, skin and fine textures, where compression artefacts show first.
  • Measure page speed with Google PageSpeed Insights or Lighthouse in Chrome's developer tools. Watch Largest Contentful Paint (LCP), which is often the main image.
  • Check file sizes before and after to confirm the savings are real.
  • Test on a phone over a mobile connection, not just a fast office network.

Which Format Where?

Use · Recommended

Website photos · AVIF or WebP, with a JPEG fallback

Logos and icons · SVG where possible; otherwise PNG or lossless WebP

Screenshots · PNG or lossless WebP

Animations · Animated WebP or a short video; GIF only for maximum compatibility

Email newsletters · JPEG and PNG; many email programs still don't support WebP or AVIF

Print · High-quality JPEG, TIFF or PNG, as your printer requests

Sending to someone else · JPEG: everyone can open it

A Note on JPEG XL

JPEG XL is a newer format with excellent compression and the ability to repackage existing JPEGs losslessly at a smaller size. Safari supports it, but most other browsers don't enable it by default yet, so it isn't a practical choice for most websites today. Keep an eye on it.

Conclusion

A simple, safe upgrade for most websites: resize images to their display size, convert photos to AVIF and WebP, keep JPEG as a fallback, and serve them with the <picture> element. Then measure the results. You'll usually see smaller pages and faster loading, with no visible loss of quality.

Try our free WebP converter and AVIF converter to get started.