Comparison
JPG, PNG, WebP, HEIC and GIF compared
Most of the format question comes down to what is actually in the picture. A photograph has millions of subtly different colours and survives lossy compression almost invisibly; a logo has a handful of flat colours and hard edges, which is exactly what lossy compression ruins. The rest is transparency and where the file has to open.
Side by side
| JPG | PNG | WebP | HEIC | GIF | |
|---|---|---|---|---|---|
| Compression | Lossy | Lossless | Both | Lossy | Lossless, 256 colours |
| Transparency | No | Yes | Yes | Yes | On/off only |
| Animation | No | No | Yes | Yes | Yes |
| Relative size, same photo | Baseline | 3-5x larger | 25-35% smaller | ~50% smaller | Much larger |
| Opens everywhere | Yes | Yes | Every current browser | Apple, limited elsewhere | Yes |
| Best for | Photographs | Logos, screenshots, flat colour | Anything on a web page | iPhone camera roll | Short looping clips |
The short answer
For a web page, WebP. For a photograph that must open in anything, JPG. For a logo, a screenshot or anything needing transparency, PNG. HEIC is what an iPhone produces and is usually the thing you are converting away from, because most software outside Apple will not open it.
In more detail
Why lossy compression suits a photograph and ruins a logo
JPEG works by throwing away detail your eye is poor at noticing, and a photograph is full of exactly that: millions of subtly different tones, gradual shifts, texture nobody inspects pixel by pixel. A logo is the opposite. It has a handful of flat colours meeting at hard edges, and a hard edge is the one thing JPEG's frequency model handles worst. The result is the faint halo you see around text saved as JPEG, which no later conversion removes because the information that would have drawn the edge cleanly is already gone.
The conversion that cannot give anything back
Converting JPG to PNG is a common request and it is worth being clear about what it achieves. The detail JPEG discarded when the photo was first saved stays discarded; PNG cannot reconstruct it. What the conversion prevents is the next loss, which matters if the file is about to be edited and re-saved several times. Going the other way, PNG to JPG, is a genuine size win on a photograph and a genuine quality loss on anything with flat colour.
HEIC is usually the format you are escaping
An iPhone photographs in HEIC by default, which is roughly half the size of the equivalent JPEG at the same quality. The trouble is everywhere else: most Windows software, a great many web forms and a fair number of printers will not open it. That is why the HEIC conversions on this site get used far more often than the reverse, and why the right answer is almost always JPG for sharing and WebP for a web page.
Modern Web Performance: WebP vs Legacy Formats for Core Web Vitals
For web performance, Google Core Web Vitals (Largest Contentful Paint) prioritizes byte weight. WebP delivers 25% to 35% smaller file sizes than comparable JPEG images while maintaining equivalent SSIM visual quality. For transparent UI badges and icons, WebP lossless outperforms traditional PNG by 26% on average. When universal legacy OS compatibility is required, JPG remains the standard fallback.