Which image format should I use?
JPG, PNG, WebP, AVIF, SVG and HEIC each exist for a reason. A short decision guide and the trade you make with each one.
Most of the time the answer is JPG for photographs and PNG for everything else and you can stop reading. The rest of this is for when that isn’t good enough.
The decision in four questions
Does it need transparency? If yes, JPG is out. PNG if it has to work everywhere, WebP if it is for the web.
Is it a photograph or is it graphics? Photographs are continuous tone and compress well with lossy formats. Graphics are flat colour and sharp edges, which lossy formats handle badly and lossless formats compress extremely well.
Where is it going? A website can use WebP freely. A print shop, an email attachment, an older desktop application or an upload form with a fixed accept list wants JPG or PNG.
Will it be edited again? If so, keep it lossless until the final export, because each lossy save compounds the last one’s damage.
The formats, briefly
JPG is the universal photograph format. Lossy, no transparency, opens absolutely everywhere. The safe answer when you don’t control the destination.
PNG is lossless with full transparency. Excellent for screenshots, logos and diagrams and a poor fit for photographs, where it can be ten times the size of a JPG that looks identical.
WebP is smaller than JPG at the same quality, supports transparency and handles sharp edges better than JPG. Every current browser reads it. Support outside the browser is patchy, which is the entire catch.
AVIF is smaller again and support is now broad in browsers. Browsers can read it but not write it, so producing AVIF needs a build tool rather than a web page.
HEIC is what an iPhone saves: roughly half the size of JPG for the same photo and frequently unopenable on Windows because the codec is licensed separately.
SVG is not an image in the same sense at all. It is drawing instructions, so it is sharp at any size and tiny for logos and icons. It can’t represent a photograph.
GIF is for animation and nothing else and even then a video file or an animated WebP does the job better wherever it is supported.
The common mistakes
A photograph saved as PNG. Usually because a screenshot tool or a design app defaulted to it. It works and the file is five to fifteen times larger than it needs to be.
A screenshot saved as JPG. The mirror image. JPG’s compression puts grey fuzz around every letter, which is why screenshots of text look subtly dirty after the round trip.
Converting to a newer format for compatibility. Converting WebP to JPG makes the file bigger, not smaller; the reason to do it is that something refuses to open WebP. If size is the goal, the levers are dimensions and quality, in that order.
Editing in a lossy format. Five rounds of open, tweak, save on a JPG is visible. Work in PNG and export once.
For a related next step see Why does my transparent PNG have a black background?.
Common questions
Is WebP always better than JPG?
Technically yes, practically not always. WebP is smaller at the same quality and supports transparency, but it is a web format: print shops, older desktop software, e-readers and many upload forms still refuse it. Use WebP on a website and JPG when the file is leaving the browser.
Should I use AVIF?
On a website, if you have a build step that can produce it, because it is smaller again than WebP. Not from a tool like this one, because no browser can write AVIF from a canvas, only read it. That asymmetry is why there are no convert-to-AVIF pages here.
When is PNG the right choice?
Screenshots, logos, icons, diagrams, anything with text or flat colour and anything needing transparency that’ll be opened by software that might not know WebP. For photographs it is almost always the wrong choice, because it produces enormous files for no visible gain.
What about GIF?
For animation and only because it is universally supported. It is limited to 256 colours, has only on-or-off transparency and produces much larger files than a video or an animated WebP for the same clip. Nothing else about it recommends it.