Which image format to use: WebP vs JPEG vs AVIF vs PNG

When to use WebP, JPEG, PNG or AVIF — including transparency, browser support, print compatibility and what each format does to quality and file size.

Published and last reviewed · Independent explainer — sources are linked, and nothing here is an endorsement.

The short answer

Use JPEG for photographs that must open everywhere, PNG when you need lossless pixels or transparency, WebP for websites you control, and AVIF when file size matters more than the oldest browser on your visitor list. Everything below is the reasoning behind that sentence.

What each format is good at

The formats differ in three ways that matter: whether they are lossy, whether they support transparency, and how widely they are accepted.

FormatCompressionTransparencyBest for
JPEGLossyNoPhotos, print workflows, maximum compatibility
PNGLosslessYesScreenshots, logos, sharp edges, pixel-exact work
WebPBothYesWebsite images: smaller than JPEG/PNG at similar quality
AVIFBothYesSmallest modern files, when you can rely on current browsers

Compatibility, honestly

WebP is supported by every current major browser, which is why it is a safe default for the web. JPEG is the only format you can hand to almost any application, printer, portal or decade-old device without thinking about it.

AVIF support is broad in current browsers but not universal, and — more importantly for this site — not every browser can *encode* AVIF. That is why the converter probes encoder support in your browser and only offers formats that will really work, instead of listing four and failing on two.

Transparency: the decision people forget

JPEG has no alpha channel. Converting a transparent PNG to JPEG means the transparent areas must become some colour, and if the converter picks black you get the familiar black box behind a logo. Pick the background colour deliberately — white for documents, a brand colour for headers.

If you need transparency preserved, stay in PNG, WebP or AVIF. A transparent logo flattened onto white cannot be un-flattened later without the original file.

Converting is not a quality upgrade

Changing the container never restores detail that a lossy format already discarded. JPEG to PNG is lossless in the sense that nothing new is lost, but the artefacts from the original JPEG remain — they are simply stored in a bigger file.

The same logic applies to file size: PNG to JPEG usually shrinks a file, and JPEG to PNG usually inflates it, with no change in what the image actually shows. Convert for compatibility or for transparency, not in the hope of improvement.

A decision list you can act on

  • Uploading to a portal that names a format? Produce exactly that format, nothing cleverer.
  • Sending a photo to a print shop? JPEG, high quality, with the pixel count the print size needs.
  • Publishing on your own website? WebP (or AVIF if you control the audience), with a fallback if you support old browsers.
  • Sharing a screenshot or a logo with sharp edges? PNG, or WebP if the file is too large.
  • Needing transparency and the smallest possible file? WebP with alpha, then compare against PNG.

Sources

Specifications and platform behaviour change. Values on this page were reviewed on ; if a source contradicts this page, the source wins — and the correction belongs in the issue tracker.

Frequently asked questions

Is WebP always smaller than JPEG?

Almost always at similar visual quality, but not by a fixed margin, and occasionally a JPEG wins. The only reliable answer comes from measuring your own file: convert it and compare the bytes and the preview.

Will converting to AVIF break my website?

Only for visitors on browsers that cannot decode it. Serve AVIF with a WebP or JPEG fallback if you need to support older browsers, or convert to WebP instead — it has broader support and still beats JPEG.

Does converting remove my photo metadata?

Yes, in practice. Re-encoding rebuilds the file from decoded pixels, so EXIF and GPS data are not carried over. If you want that verified rather than assumed, the metadata tool shows the before and after.

What about HEIC files from an iPhone?

HEIC is the camera default on recent iPhones, and most non-Safari browsers cannot decode it at all. Converting to JPEG in a browser that can decode it — Safari, or on macOS — is the reliable path, and the converter tells you precisely when your browser cannot do it.