Three formats cover practically everything you will ever publish. Here is what each one is good at, and the decision rules that follow.
JPG stores photos efficiently by discarding detail people rarely notice. It supports 16.7 million colours but no transparency, and it is lossy — each save loses a little more.
PNG is lossless and supports full alpha transparency. It keeps every pixel exactly as drawn, which makes it perfect for graphics — and wasteful for photos, where a PNG can easily be 5–10× larger than the equivalent JPG.
WebP does both: it can be lossy like JPG or lossless like PNG, and it supports transparency in both modes. In lossy mode it is typically 25–35% smaller than JPG at the same visual quality; in lossless mode it beats PNG by a similar margin. Every current browser supports it.
AVIF compresses even better than WebP — often another 30–50% — and supports HDR and transparency. The catch is encoding speed and uneven tool support: many image editors and CMS pipelines still cannot produce or display it reliably. If your stack supports it, use AVIF with a WebP fallback; otherwise WebP is the safe modern default.
Converting between lossless formats (PNG → lossless WebP) is lossless. Converting anything into JPG is lossy once. Converting JPG → PNG does not recover quality — it just makes a bigger file that still contains the original artefacts.
JPG has no alpha channel, so transparent pixels have to become something. Most tools fill them with white, which is usually what you want for product photos, but on a dark web page the result is a white box. If you are converting a transparent PNG to JPG, check what fill colour the tool uses.
Try it now: Convert Image · jpg-to-webp · jpg-to-png