Image Optimization

How to Convert JPG to AVIF for Free

Convert JPG to AVIF for free in your browser: pick a quality, compare file sizes, download a ZIP and serve it with a fallback. Nothing is uploaded.

By Franel II Romanillos, Technical SEO Specialist

#avif #jpg #image optimization

To convert a JPG to AVIF, drop the file into an AVIF converter, choose a quality around 50 to 70 for photos, check that the result looks right and is smaller, then download it. With the free Image to AVIF Converter this happens in your browser, so your photos are not uploaded anywhere.

New to the format? Read What Is AVIF? first.

Step by step

  1. Open the Image to AVIF Converter.
  2. Drag your JPG files onto the box, or click to choose them. You can add up to 50 images at a time.
  3. Set the options (see below). Conversion starts automatically.
  4. For each image, check the before and after sizes and the percentage saved.
  5. Download files one by one, or use Download all as ZIP.
  6. If you change a setting, click Convert again to apply it to the images in the list.

Which settings to choose

SettingWhat it doesA good starting point for photos
QualityHigher is better looking and larger50 to 70
Compression effortSlower settings take longer and can make smaller filesBalanced
Max widthScales large images down before convertingMatch the largest size your site displays, such as 1600 px
LosslessKeeps every pixel, but files are much largerOff, except for special cases

Start at 60 and compare the result at full size. If you see blocky skies or smeared detail, raise the quality to 70. If you cannot tell the difference, try 50 and see how much smaller the file gets. The right number depends on the photo, so test a couple of different images.

Do not skip resizing

A 4000 pixel wide photo shown in an 800 pixel slot wastes bytes in any format. If your original is much larger than the biggest size your site displays, set a max width. Combined with AVIF, this often saves more than changing the quality setting.

Check the result

  • Look at it at full size, especially skies, skin, text and fine detail.
  • Compare the file size with the original. If the AVIF is not smaller, which can happen with small, already optimized JPEGs, keep the original or try a lower quality.
  • Check the dimensions are what you expect.

Start from the best original you have

JPEG is already a lossy format. Converting it to AVIF cannot bring back detail that JPEG discarded, and compressing twice can add small artifacts. If you still have the original camera file or an uncompressed export, convert that instead of an already compressed JPEG.

Use the AVIF files on your website

Upload the AVIF files and serve them with a fallback so every visitor sees an image:

<picture>
  <source srcset="/images/photo.avif" type="image/avif">
  <img src="/images/photo.jpg" alt="Describe what the image shows"
       width="1200" height="800" decoding="async">
</picture>

AVIF works in current versions of Chrome, Edge, Firefox, Opera and Safari, and Can I use shows roughly 95 percent of users covered, but older browsers need the fallback. Keep your original JPG as that fallback. Always give the image alt text, and give it width and height to prevent layout shift. If the image is the large one at the top of the page, do not lazy-load it.

Other ways to convert

You can also use a desktop image editor that exports AVIF, or a command-line encoder such as avifenc from the libavif project. The advantage of a browser-based tool is that there is nothing to install and your files stay on your device.

What to do if it does not work

  • The AVIF is larger than the original. Lower the quality, use a slower effort setting, or keep the JPG.
  • The preview shows nothing. Your browser may be too old to display AVIF. The download is still valid.
  • It takes a long time. Large images take longer to encode. Set a max width to speed it up.
  • The image is rejected. Check that the file really is a JPG, PNG or WebP, and is not an unusual format such as HEIC.

Frequently asked questions

Is converting JPG to AVIF free?

Yes. The converter is free, with no sign-up and no watermark.

Are my images uploaded to a server?

No. The conversion runs in your browser with a WebAssembly encoder, so the images stay on your device.

How much smaller will my JPG be as AVIF?

It depends on the image and the quality setting. MDN’s guide says lossy AVIF can be around half the size of JPEG at similar visual quality, but test your own images to see what you get.

What quality should I use?

For photos, 50 to 70 is a good range. Test one or two images at full size before converting a whole set.

Will AVIF work on every device?

All current major browsers support it. Older ones do not, so keep a JPG or WebP fallback with the picture element.

Can I convert PNG and WebP too?

Yes. The same tool converts PNG, WebP, GIF (first frame only), BMP and AVIF files.

Sources

  1. MDN Web Docs: Image file type and format guide
  2. Can I use: AVIF image format