Image tools

How to Convert JPG and PNG to AVIF

What AVIF is, how much smaller it makes photos and graphics, which quality setting to pick, how to serve it on a website with a fallback, and when to stay with JPG.

6 min readUpdated

AVIF is an image format built on AV1, the video codec that streaming services adopted to cut their bandwidth bills. A still image is just one video frame, and the tools AV1 uses to squeeze video - predicting each block from its neighbours, and smoothing away detail the eye will not miss - work just as well on photos. The practical result is that an AVIF is commonly around half the size of a JPG that looks the same, and smaller than WebP too.

For a website that is a straightforward win: the same pictures, fewer bytes, faster pages. This guide covers how to convert your images with the AVIF Converter, how to choose a quality setting, how to publish AVIF safely, and the cases where JPG is still the better choice.

How to convert an image to AVIF

  1. Open the AVIF Converter and drop in one or more JPG, PNG or WebP files. GIF and BMP work too.
  2. Leave Quality at 50 for a first try. The next section explains when to move it.
  3. Press Convert to AVIF. Each result shows its dimensions and its size before and after, so you can see the saving at a glance.
  4. Download the files one by one, or all together as a zip.

Everything happens in your browser. The encoder - libaom, the reference AV1 encoder, compiled to WebAssembly - runs in a background worker on your own device, so nothing is uploaded. It is about a megabyte to download, and it only loads when you first press Convert.

Choosing a quality setting

The number on AVIF's quality slider does not mean the same thing as the number on a JPG export dialog. A JPG saved at 50 looks visibly blocky; an AVIF at 50 usually does not. That is because the two formats fail differently. When JPG runs short of bytes it breaks the picture into visible 8 x 8 squares and halos around edges. AVIF instead smooths away fine texture - skin pores, distant foliage, film grain - while keeping edges clean. At moderate settings that loss is very hard to spot.

  • 40-50: hero images, backgrounds and blog photos. This is where AVIF's size advantage is largest.
  • 60-75: product photos, portfolios and anything people zoom into.
  • Below 35: large decorative backgrounds where softness does not matter.
  • 100: lossless. Every pixel is kept exactly, but the file is usually larger than the JPG you started with, so it is rarely worth it for photos.

A quick way to settle on a number is to convert one representative image at 50, open the result next to the original at full size, and look at the areas with the finest texture. If you can see the smoothing, step up by ten and try again. Once you are happy, convert the rest of the batch at that setting.

When the AVIF comes out bigger

Occasionally a converted file is larger than the original, and the tool flags it in the result line. This happens with images that were already compressed very hard - a 30 KB thumbnail, or a JPG that has been re-saved several times - and with small flat graphics where a well-optimised PNG is already tiny. Lower the quality, or keep the original; converting an already-small file buys you little either way.

Worked example: one photo at four settings

To see the scale of the saving, take an aerial landscape photo resized to 2000 x 1054 pixels. Saved as a JPG at quality 85 - a typical export setting - it is 528 KB. Through the converter it comes out at 53 KB at quality 40, 79 KB at 50, 120 KB at 60 and 178 KB at 75. Even the highest of those is a third of the JPG, and the default setting is about a seventh. A photo straight off a phone or camera, saved at quality 90 or more, usually shows an even bigger gap. Your own pictures will vary with how much fine detail they hold, which is why the converter shows the before and after size of every file.

What the encoder has to hold in memory

AVIF encoding is far more work than JPG encoding, and it all happens on your device, so it helps to know what a large photo asks of it. A 12-megapixel phone photo is 4032 x 3024 pixels. Decoded to raw colour with an alpha channel, that is 4032 x 3024 x 4 bytes = 48,771,072 bytes, or about 49 MB, before the encoder makes its own working copies. That is comfortable on a laptop and usually fine on a recent phone.

A 100-megapixel scan or panorama, by contrast, is over 400 MB of raw pixels, which is more than many phone browsers will give a single tab. That is why the converter refuses images over 50 megapixels and asks you to resize them first - the image resizer will bring a panorama down to a sensible web width, which you would want for a web page anyway. Time scales the same way: a 2-megapixel photo takes around a second or two on a laptop, and a 12-megapixel one several times that, longer still on a phone.

Using AVIF on a website

Every current major browser displays AVIF: Chrome since version 85, Firefox since 93, Safari since 16 on both Mac and iPhone, and Edge since early 2024. That covers the overwhelming majority of visitors, but not all of them, so the safe pattern is a picture element that offers AVIF first and falls back to a JPG:

  • <picture>
  • <source srcset="photo.avif" type="image/avif">
  • <img src="photo.jpg" alt="Description of the photo" width="1600" height="1200">
  • </picture>

A browser that understands AVIF downloads only the AVIF; one that does not skips the source line and loads the JPG. Keep the width and height on the img tag so the page does not jump while the image loads. Many content management systems and image CDNs will do this negotiation for you once you upload AVIF versions.

When to stay with JPG or PNG

  • Sending a photo by email or chat, or uploading it to a form. Plenty of desktop software, older phones and government or exam portals still do not accept AVIF.
  • Printing. Print shops and photo labs expect JPG or TIFF.
  • Keeping an editable master. AVIF is a delivery format; keep your original files for editing and convert copies for the web.
  • Photos where the camera details matter. The converter does not carry EXIF data such as the date or GPS location across, though it does apply the photo's rotation so it stays upright.
  • Animation. Animated GIF and WebP files are converted from their first frame only.

If you need a smaller file in one of the traditional formats instead, the image compressor handles JPG and WebP, and Compress PNG shrinks PNGs without changing a pixel. To turn an AVIF back into a JPG or PNG, open it in the image converter.

Frequently asked questions

Is AVIF better than WebP?
For photos, usually yes: at the same visual quality AVIF files are typically smaller than WebP, and AVIF supports wide colour and HDR, which WebP does not. WebP encodes much faster and has been supported in browsers for longer, so it remains a reasonable fallback. Many sites serve AVIF first, then WebP or JPG for browsers that cannot show it.
Why does converting to AVIF take longer than saving a JPG?
AV1 compression tries many more ways of predicting each block of the picture and keeps the cheapest, which is where its size savings come from. That search is CPU-heavy, and here it runs on your own device rather than a server. The encoder's own speed setting is fixed at its default because, in testing, the fastest setting doubled the file size and the slowest took about seven times as long to save 2%.
Does converting to AVIF lose quality?
Below quality 100 it is lossy, like JPG, so some detail is discarded - but at sensible settings the loss is very hard to see. Converting a JPG to AVIF cannot restore detail the JPG already lost, so always convert from the best original you have rather than from a heavily compressed copy.