JPG, PNG, WebP or AVIF: Which Image Format to Use
Four formats cover almost every picture on the web. They differ in three things: whether they keep every pixel exactly, whether they can hold transparency, and what opens them. Once you know which of the three matters for your picture, the choice is usually short.
The short answer
| You have | Use | Why |
|---|---|---|
| A photo for a web page | WebP, with a JPG copy where it must open everywhere | Smaller files, and every current browser shows WebP |
| A screenshot, diagram or line art | PNG | Lossless, so sharp edges stay sharp |
| A logo with a transparent background | PNG or WebP | JPG cannot store transparency |
| A photo where size matters most | AVIF, with a WebP or JPG fallback | Often the smallest, but support is newer |
| A picture you may edit again | Keep the PNG or the original file | Converting a lossy copy again loses more |
JPG: opens everywhere, loses a little every time
JPG is lossy: it throws away fine detail the eye is least likely to notice, and converting a JPG again throws away a little more. MDN states that JPEG does not support an alpha channel, so a transparent area has to be filled with a colour when a picture is saved as JPG. Its strength is that every program, e-mail client and upload form accepts it, which is why it is still the usual fallback for photographs.
PNG: every pixel exactly
PNG is lossless and supports full alpha transparency. MDN prefers it when a picture needs a precise reproduction or transparency, and for screenshots, diagrams and line art. The price is size: a photo saved as PNG is large, because every pixel is kept exactly.
WebP: smaller, and shown by every current browser
Google’s WebP FAQ gives two figures. Lossless WebP images are 26% smaller than PNGs, and lossy WebP typically achieves an average of 30% more compression than JPEG. How much one particular picture saves varies, so look at the size you actually get. WebP supports an alpha channel for transparency, and the largest picture it can hold is 16383 × 16383 pixels. MDN lists support in all current versions of Chrome, Edge, Firefox, Opera and Safari; on a Mac, Safari needs version 14 or later and macOS Big Sur or newer.
AVIF: often the smallest, newer in the browsers
AVIF is a good choice for photographs. MDN says it offers slightly better compression than WebP but is not as widely supported and does not support progressive rendering. According to MDN it is shown by Chrome 85, Opera 71, Firefox 93, Safari 16.1 and Edge 121 and later, and it recommends providing a fallback in WebP, JPEG or PNG with the picture element. Many programs and upload forms still cannot open an AVIF file, which is the usual reason people need to convert one to a JPG.
How to choose in practice
- Keep the original, whatever it is. A PNG or the camera file is your master copy.
- For the copy shown on a page, try WebP first and compare the size with the original.
- If the converted file is larger, as can happen with small icons, keep the original format.
- If the picture has to be opened by someone else’s program or uploaded to a form, use JPG or PNG.
- Do not convert a converted copy again. Every lossy conversion loses a little more.
Convert in your browser
The converter pages on MultiKit turn PNG, JPG, WebP, AVIF and HEIC into one another, show the size of each result, and never upload the file.