PNG vs JPG vs WebP, in one line each: JPG for photos that leave your site, PNG for screenshots, logos and anything that must stay pixel-exact, WebP as the everyday web default. AVIF now beats all three on size and every current browser shows it. Below are measured file sizes for the four formats rather than rules of thumb.
PNG vs JPG vs WebP vs AVIF: Quick Comparison
| Feature | PNG | JPG | WebP | AVIF |
|---|---|---|---|---|
| Compression | Lossless | Lossy | Lossy + lossless | Lossy + lossless |
| Transparency | Yes | No | Yes | Yes |
| Animation | APNG (limited) | No | Yes | Yes |
| Browser support | Universal | Universal | All current browsers | Chrome, Firefox, Safari 16.4+, Edge |
| Encoding speed | Fast | Fast | Fast | Slow (seconds per image) |
| Best for | Sharp edges, transparency | Photos anywhere | Everyday web images | Smallest page weight |
Measured File Sizes
Three images saved from the same lossless source with the Pillow library: JPG and WebP at quality 80, AVIF at quality 60:
| Source image | PNG | JPG q80 | WebP q80 | AVIF q60 |
|---|---|---|---|---|
| Photo, 1920×1440 | 2 356 KB | 201 KB | 90 KB | 76 KB |
| Text screenshot, 1224×1584 | 39 KB | 55 KB | 14 KB | 9 KB |
| Flat-colour graphic, 1024×1024 | 17 KB | 22 KB | 6 KB | 5 KB |
The pattern holds across all three: WebP lands at half of JPG or less, AVIF below that. On the photo, AVIF was 2.6× smaller than JPG. The trade-off is encoding time, which matters for upload pipelines, not for images you export once.
Note what PNG costs on a photograph: 2.36 MB against 201 KB for JPG. PNG is the wrong tool for photographic content, and it always has been.
PNG: Lossless Quality and Transparency
PNG uses lossless compression — what you save is exactly what you get back. That makes it the safe choice for anything with sharp edges: screenshots with text, logos, diagrams, UI mockups, and any image that will be edited and re-saved repeatedly.
Use PNG when: you need pixel-exact output, transparency that works everywhere, or an intermediate file you'll keep editing.
Avoid PNG for: photographs. In the test above the PNG photo was nearly 13× the size of the JPG.
JPG: The Universal Photo Format
JPG has been the photographic standard since the early 1990s. Its lossy compression is tuned for gradients and detail, and every device on earth opens it.
Use JPG when: the file leaves your control — email attachments, print shops, marketplaces, older CMSes, anything embedded in a document.
Avoid JPG for: screenshots and flat graphics (visible artifacts around text), anything needing transparency, and files you'll re-edit many times, since each save discards more data.
JPEG vs JPG — What's the Difference?
Nothing. They are the same format. The three-letter extension is a leftover from MS-DOS, which allowed only three characters, and Windows kept it. Files named .jpeg and .jpg are byte-for-byte identical in structure, and renaming one to the other changes nothing. If a website rejects your .jpeg file, rename the extension and upload again.
WebP vs PNG and JPG: The Practical Default
Google released WebP in 2010; today every current browser supports it. It does lossy and lossless, transparency and animation, and in our measurements it cut JPG's size by half or more.
Use WebP when: you're serving images on the web and want a single format that covers photos, graphics and transparency.
Watch out for: email clients, which still handle WebP inconsistently, and older desktop editors that open WebP but can't export it.
AVIF: Smallest Files Today
AVIF stores images with the AV1 video codec. It reached general browser support in 2024 (Chrome, Firefox and Edge earlier, Safari from 16.4), and it produced the smallest file in every test above — 38 KB for a photo that JPG needed 189 KB for.
Use AVIF when: page weight is the priority, images are exported once and served many times, and you can supply a WebP or JPG fallback for the few clients that lack support.
Watch out for: encoding time, patchy support in design tools, and social platforms that re-compress everything you upload anyway.
Which Format Should You Pick?
- Does it need transparency? Yes → WebP or PNG (AVIF also works, PNG is the safest). No → continue.
- Is it a photograph? Yes → AVIF first, WebP as the practical default, JPG as the fallback. No → continue.
- Is it a screenshot, chart or logo? → PNG for pixel-exact text, or WebP lossless if page weight matters.
- Will it leave your website? (email, print, a client's document) → JPG or PNG. Modern formats create support questions you'll have to answer.
- Is it going to a social platform? → JPG or PNG. Every platform re-compresses on upload, so a smaller modern format buys you nothing.
Serving Modern Formats Without Breaking Old Clients
The <picture> element lets the browser choose and falls back on its own:
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img src="hero.jpg" alt="Product photo" width="1920" height="1440">
</picture>
If you use a CDN with automatic format negotiation (Cloudflare Images, Cloudinary, imgix and similar), it does the same thing from a single upload based on the Accept header. Design tools are uneven here — many still export only PNG and JPG — so make the modern-format conversion the last step of your export pipeline.
Converting Between Formats
- PNG to JPG — shrink photos saved in the wrong format
- JPG to PNG — when you need transparency or lossless editing
- WebP to PNG — when a tool refuses to open WebP
- WebP to JPG — for email, print and older software
Related articles
- HEIC to JPG: Convert iPhone Photos — Apple's format and how it compares
- SVG to PNG: Convert Vector Graphics to Raster — when raster is the right answer
- Reduce Image File Size Without Losing Quality — practical compression settings
Conclusion
For the open web today: AVIF where you can, WebP as the default, JPG and PNG as fallbacks and for anything that leaves your site. The measured gaps are large — 201 KB versus 90 KB versus 76 KB for the same photograph — so format choice is one of the cheapest performance wins available. Keep PNG for sharp-edged graphics and transparency, and stop using it for photos.