The short answer
Pick by job, not by habit. JPG is for photos you send around. PNG is for screenshots, logos and anything with transparency that has to open everywhere. WebP does both jobs in smaller files on the web. AVIF is the newest and smallest, for websites where every kilobyte counts.
| Job | Use | Why |
|---|---|---|
| Photo to email, upload or print | JPG | Opens everywhere, small enough, no transparency needed |
| Photo on your own website | WebP or AVIF, JPG fallback | 25 to 50% smaller at the same look |
| Screenshot with text | PNG or lossless WebP | Lossless keeps text edges crisp |
| Logo or icon | SVG, else PNG | Flat colors stay sharp at any size |
| Transparent image | PNG, WebP or AVIF | JPG has no alpha channel |
| Short animation | Animated WebP, else GIF | GIF is limited to 256 colors |
JPG: photos that go anywhere
JPEG is lossy. It drops detail the eye does not notice in a photo, and that is why it typically reaches about 10:1 compression (Wikipedia). Do the math for a 12 megapixel phone photo: 12.2 million pixels at 3 bytes each is 36.6 MB uncompressed, and 10:1 brings it to about 3.7 MB. Every browser, phone, printer and upload form accepts it.
Its limits are just as clear. JPEG does not support an alpha channel, so there is no transparency (MDN). And MDN warns that for screenshots, diagrams, logos and line art "blurring and colored fringes around text and sharp edges are very visible", which is why a screenshot saved as JPG looks worse than the same screenshot as PNG. Keep the original and compress a copy, so you can always go back. The image compressor does that in your browser, and the PNG to JPG converter turns a transparent background into the color you pick.
PNG: lossless, with real transparency
PNG stores every pixel exactly, with full alpha transparency (MDN), so a pixel can be fully opaque, fully transparent or anything in between. MDN's advice is to prefer it over JPEG "for more precise reproduction of source images, or when transparency is needed", which makes it the right format for logos on colored backgrounds, charts, icons and screenshots with text. It also makes it a poor format for photos: millions of slightly different colors cannot be packed tightly without loss, so a photo as PNG is often several times the size of the same photo as JPG.
PNG can also use an indexed palette like GIF (MDN), which keeps a flat logo tiny. If you need the lossless pixels of a JPG for editing, the JPG to PNG converter makes a PNG copy, and the background remover gives you a transparent PNG from a photo.
WebP: smaller than both, on the web
WebP, made by Google, has a lossy mode and a lossless mode, both with transparency and animation. Google's own measurements: lossy WebP is 25 to 34% smaller than JPEG at the same SSIM quality index, and lossless WebP is 26% smaller than PNG. Transparency in lossless WebP costs about 22% extra bytes, and lossy WebP with transparency is typically 3 times smaller than the same image as PNG. Animated GIFs converted to lossy WebP come out 64% smaller, to lossless WebP 19% smaller.
Browser support is no longer a worry. Chrome 32, Firefox 65 and Edge 18 handle every WebP feature, and Safari has done so since version 14 on iOS 14 and macOS Big Sur (Google's FAQ). caniuse puts WebP at about 97% of browsers in use. The one hard limit is size: a WebP image can be at most 16,383 by 16,383 pixels (MDN), so a giant panorama or a poster scan stays JPG or PNG.
Where WebP still falls short is outside the browser. Not every app or upload form accepts it. For those, convert back with the WebP to JPG or WebP to PNG tool. The other way round, the WebP converter, JPG to WebP and PNG to WebP tools make web-ready copies at the quality you choose.
AVIF: the smallest, with a few catches
AVIF is based on the AV1 video codec and standardized by the Alliance for Open Media (web.dev). It supports lossy and lossless compression, an alpha channel, animation, high dynamic range and wide color gamut (MDN, web.dev). The web.dev team writes that it has seen savings of more than 50% against JPEG. Jake Archibald's test with a racing photo at acceptable quality came out at 74.4 kB as JPEG, 43 kB as WebP and 18.2 kB as AVIF. The gains are biggest on photos and smooth gradients; on a flat illustration his PNG and AVIF were only a few kilobytes apart.
Support arrived later than for WebP: Chrome 85, Firefox 93, Safari 16.4 (16.1 to 16.3 were partial) and Edge 121 (caniuse), which adds up to about 96% of browsers in use. Two catches remain. An AVIF does not load progressively; the whole image appears at once, which Archibald found better suited to smaller, quick-loading images. And apps and upload forms accept AVIF even less often than WebP. For a website, make AVIF copies with the JPG to AVIF or PNG to AVIF tool and keep a JPG fallback. For everything else, the AVIF to JPG converter gets you a file that opens anywhere.
GIF: only for old-style animations
A GIF stores each pixel as an index into a palette of at most 256 colors, and a pixel is either fully opaque or fully transparent (MDN). Photos get banding, soft edges get jagged, and the files are large for what they show. Google's example animation is 85 KB as a GIF and 5 KB as a lossless animated WebP. Use GIF only when the place you post to accepts nothing else. For a still frame, the GIF to PNG tool saves the first frame as a clean PNG.
Logos and icons: SVG first
A logo drawn as vectors (SVG) has no pixels. MDN calls SVG "ideal for diagrams, icons, and other images which can be accurately drawn at any size", and not useful for photos. Keep the SVG as your master. When a form, a social profile or a document needs a raster image, the SVG to PNG converter renders it at 1×, 2×, 4× or an exact width, with the transparent background intact. For a browser tab icon, the favicon generator makes every size at once.
Browser support at a glance
| Format | Chrome | Firefox | Safari | Edge | In use |
|---|---|---|---|---|---|
| JPG, PNG, GIF | All | All | All | All | All |
| WebP | 32 | 65 | 14 (iOS 14, macOS 11) | 18 | about 97% |
| AVIF | 85 | 93 | 16.4 (16.1 partial) | 121 | about 96% |
Versions from Google's WebP FAQ, MDN and caniuse. "In use" is the global usage share caniuse reported at the time of writing.
Three rules to remember
- Sending or uploading? JPG for photos, PNG for everything else. They open everywhere and no form rejects them.
- Publishing on your own site? WebP, and AVIF for the big photos. Keep a JPG or PNG fallback for the last few percent of browsers.
- Transparency or crisp text? Never JPG. PNG, WebP or AVIF, in that order of compatibility.
Converting never adds detail that was lost. A JPG turned into PNG is a lossless copy of a lossy file, and it gets bigger, not better. Convert from the original whenever you still have it.
Frequently asked questions
Which image format is best for a website?
For photos, WebP or AVIF with a JPG fallback. Google measured lossy WebP at 25 to 34% smaller than JPEG at the same SSIM quality, and the web.dev team has seen AVIF savings of more than 50% against JPEG. Both are supported by about 96 to 97% of browsers in use according to caniuse. For logos and icons, use SVG when you have it and PNG otherwise.
Does JPG support transparency?
No. JPEG has no alpha channel, so a transparent area becomes a solid color, usually white or black, when you save as JPG. Use PNG, WebP or AVIF for anything that needs transparency.
Is WebP better than PNG for screenshots?
Usually yes, in size. Lossless WebP keeps every pixel like PNG does, and Google measured it at 26% smaller than PNG. PNG still wins when the file has to open in an older app or an upload form that only lists JPG and PNG.
Should I convert all my photos to AVIF?
For a website, AVIF is worth it for large photos where every kilobyte counts. For files you send to people or upload to forms, keep JPG: it opens everywhere, while AVIF needs Chrome 85, Firefox 93, Safari 16.4 or Edge 121 and is not accepted by many upload forms.
Why is my PNG so much bigger than the same picture as JPG?
PNG is lossless, so a photo with millions of slightly different colors cannot be stored compactly. JPEG throws away detail the eye does not notice and typically reaches about 10:1 compression. PNG is only small for images with few colors and flat areas, like logos, charts and screenshots.
Sources
- An image format for the Web (WebP): size comparisons, alpha and animation support
- WebP FAQ: browser support and compression figures, Google
- Image file type and format guide, MDN Web Docs
- AVIF image format: browser support and usage, caniuse
- WebP image format: browser support and usage, caniuse
- Using AVIF to compress images on your site, web.dev
- AVIF has landed, Jake Archibald (size examples)
- JPEG, Wikipedia (typical compression ratio)