Reference

Which format should you actually use?

Most format comparisons list features. What usually decides the question is narrower: whether you need transparency, whether the image is photographic or flat, and what has to be able to open it. This page covers those, and is explicit about when each format is the wrong choice — the part that is normally left out.

Image formats

Comparison of JPEG, PNG, WebP, AVIF and GIF
FormatCompressionTransparencyAnimationColourSupport
JPEG.jpgLossyNoNo8-bitUniversal (1992)
PNG.pngLosslessYes (8-bit)APNG only8/16-bitUniversal (1996)
WebP.webpBothYes (8-bit)Yes8-bitAll current browsers; Safari 14+ (2020)
AVIF.avifBothYes (10/12-bit)YesUp to 12-bit, HDRChrome/Firefox/Edge; Safari 16+ (2022)
GIF.gifLossless (palette)1-bit onlyYes256 coloursUniversal (1987)

JPEG

Use it for: Photographs where file size matters and transparency does not.

Avoid for: Screenshots, logos, text, line art — JPEG rings around sharp edges.

PNG

Use it for: Screenshots, logos, diagrams, anything needing transparency or exact pixels.

Avoid for: Large photographs — expect files several times bigger than JPEG.

WebP

Use it for: General web delivery — roughly 25-35% smaller than JPEG at matched quality.

Avoid for: Email attachments and older desktop software, where support is patchy.

AVIF

Use it for: Maximum compression — commonly ~50% smaller than JPEG, and far better on gradients.

Avoid for: Anything where encode time matters; AVIF is several times slower to encode.

GIF

Use it for: Short animations in contexts that accept no video element.

Avoid for: Photographs and anything long — the 256-colour palette bands, and files balloon.

Video formats

Comparison of MP4, WebM, MOV, MKV and AVI
ContainerCompressionSupportBest for
MP4 (H.264).mp4LossyUniversal, hardware decodedAnything that has to play everywhere — social platforms, phones, editors.
WebM (VP9).webmLossyAll modern browsers; weaker on iOSSelf-hosted web video — smaller than H.264 at matched quality, and royalty-free.
MOV.movVariesApple-native; widely readableApple recording and editing workflows; can carry professional codecs like ProRes.
MKV.mkvVariesDesktop players; poor on phones and browsersArchival, and anything needing multiple audio or subtitle tracks.
AVI.aviVaries (legacy)Legacy desktop onlyNothing new. It survives as an archive format.

Choosing quickly

  • Does it need transparency?

    PNG, WebP or AVIF. Not JPEG — it has no alpha channel, so transparent pixels flatten onto a solid background.

  • Is it a photograph for the web?

    WebP first, AVIF if encode time is not a concern, JPEG as the universal fallback.

  • Is it a screenshot, logo or diagram?

    PNG or lossless WebP. JPEG rings visibly around sharp edges and text.

  • Is it a short animation?

    MP4 or WebM with autoplay/loop/muted. GIF only where a video element is not allowed.

  • Does it have to play everywhere?

    MP4 with H.264. Nothing else comes close on compatibility.

  • Is bandwidth the binding constraint?

    WebM with VP9, or AVIF for stills — both beat the universal options meaningfully.

Three things people get wrong

Converting to a lossless format does not restore quality

Saving a JPEG as PNG stops further degradation but cannot recover detail already discarded. The artifacts are in the pixels now, and PNG will preserve them faithfully. Nothing can undo lossy compression.

A bigger file is not a better image

Converting a photograph from JPEG to PNG typically multiplies its size several times over while looking identical. Size follows the compression scheme, not the quality.

Repeated conversion compounds loss

Every lossy-to-lossy conversion decodes and re-encodes, losing a little more each time. Keep an original master and convert from it, rather than converting a conversion.

Convert between them

All conversions run in your browser — nothing is uploaded.