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.
| Format | Compression | Transparency | Animation | Colour | Support |
|---|---|---|---|---|---|
| JPEG.jpg | Lossy | No | No | 8-bit | Universal (1992) |
| PNG.png | Lossless | Yes (8-bit) | APNG only | 8/16-bit | Universal (1996) |
| WebP.webp | Both | Yes (8-bit) | Yes | 8-bit | All current browsers; Safari 14+ (2020) |
| AVIF.avif | Both | Yes (10/12-bit) | Yes | Up to 12-bit, HDR | Chrome/Firefox/Edge; Safari 16+ (2022) |
| GIF.gif | Lossless (palette) | 1-bit only | Yes | 256 colours | Universal (1987) |
Use it for: Photographs where file size matters and transparency does not.
Avoid for: Screenshots, logos, text, line art — JPEG rings around sharp edges.
Use it for: Screenshots, logos, diagrams, anything needing transparency or exact pixels.
Avoid for: Large photographs — expect files several times bigger than JPEG.
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.
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.
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.
| Container | Compression | Support | Best for |
|---|---|---|---|
| MP4 (H.264).mp4 | Lossy | Universal, hardware decoded | Anything that has to play everywhere — social platforms, phones, editors. |
| WebM (VP9).webm | Lossy | All modern browsers; weaker on iOS | Self-hosted web video — smaller than H.264 at matched quality, and royalty-free. |
| MOV.mov | Varies | Apple-native; widely readable | Apple recording and editing workflows; can carry professional codecs like ProRes. |
| MKV.mkv | Varies | Desktop players; poor on phones and browsers | Archival, and anything needing multiple audio or subtitle tracks. |
| AVI.avi | Varies (legacy) | Legacy desktop only | Nothing new. It survives as an archive format. |
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.
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.
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.
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.
All conversions run in your browser — nothing is uploaded.