Photos & images
PNG vs JPG vs WebP - Which Image Format Should You Use?
JPG for photos, PNG for graphics, WebP for the web, and when AVIF or SVG beats them all. How each format works, what happens to quality, and how to choose.
Updated · 4 min read
Pick the wrong image format and you get either a blurry logo or a 5 MB photo that slows down your page. The rule of thumb fits on one line: JPG for photos, PNG for graphics, WebP for websites. The reasons are worth knowing though, because they tell you what to do when a case doesn't fit neatly.
Lossy vs. lossless
The main difference between formats is what they do with data.
Lossless compression shrinks a file without changing a single pixel, like a ZIP file for images. You can open and save it as many times as you like, and it won't get worse.
Lossy compression throws away detail the eye is unlikely to notice. Files get much smaller, but the removed information is gone for good, and each new save loses a little more.
JPG: made for photos
JPG (also written JPEG) has been around since the early 1990s, and it opens everywhere. It's lossy, and it's tuned for smooth color gradients and fine natural texture, which makes it excellent for photographs.
It struggles with hard edges. Text, line art and flat areas of color get fuzzy "halos" around them, and it can't store transparency.
Use it for: photos, and anywhere compatibility matters, such as email attachments and upload forms.
PNG: made for graphics
PNG is lossless and supports full transparency. It's great at flat colors and sharp edges, because it compresses repeated patterns very well.
Its weakness is photos. A PNG of a photo is often five to ten times bigger than a good JPG, with no visible benefit.
Use it for: screenshots, logos, icons, diagrams, and anything with transparency or text.
WebP: the modern all-rounder
WebP was developed by Google and does both jobs, offering lossy and lossless modes and transparency. A lossy WebP is typically 25–35% smaller than a comparable JPG, and a lossless one is typically about a quarter smaller than a PNG. All current browsers support it.
Its weakness is outside the browser. Some older image editors, office software and upload forms still refuse it. That's why people end up searching for ways to turn a WebP into a PNG.
Use it for: website images, where smaller files mean faster pages.
At a glance
| JPG | PNG | WebP | AVIF | |
|---|---|---|---|---|
| Compression | Lossy | Lossless | Both | Both |
| Transparency | No | Yes | Yes | Yes |
| Animation | No | Limited (APNG) | Yes | Yes |
| Best for | Photos | Graphics, screenshots | Websites | Websites, smallest files |
| Compatibility | Everywhere | Everywhere | All modern browsers | Modern browsers |
What about AVIF, SVG and GIF?
AVIF usually compresses even better than WebP, especially at low quality settings. It's slower to encode, and support outside browsers is still patchy. It's a good choice if you serve images from a website and offer a fallback.
SVG is different altogether. It stores shapes rather than pixels, so it stays sharp at any size. Use it for logos and icons where you have a vector original. It's not suitable for photos.
GIF is limited to 256 colors, and it's only still around for short animations. A short video or an animated WebP gives better quality in a far smaller file.
HEIC is the default on iPhones. It's efficient, but it isn't widely supported on other systems, as our guide on converting HEIC to JPG explains.
Common mistakes
Converting a JPG to PNG to "improve quality". The JPG artifacts are already in the pixels. A PNG will preserve them perfectly and make the file several times bigger.
Editing and resaving a JPG repeatedly. Each save loses a little more detail. Work from a master, and only export a JPG at the end.
Saving a photo as PNG for a website. A 4 MB image can often be a 300 KB one without a visible difference. The image compressor shows before and after, side by side.
Saving a screenshot as JPG. Text picks up fuzzy artifacts. A PNG is often smaller and always sharper for this kind of image.
Using a JPG for a logo on a colored background. JPG has no transparency, so the logo gets a white box. Use PNG, WebP or SVG instead.
A quality setting that works
For JPG and WebP, a quality of 75–85 is usually a good balance. Above 90, files grow quickly with little visible benefit. Below 60, artifacts start to appear, especially around edges and in smooth skies.
Don't judge from a thumbnail. Compare at actual size, and look at areas with fine detail and smooth gradients. A number isn't comparable across formats either: quality 80 in JPG isn't the same as quality 80 in WebP.
Size often matters more than format. A 6,000-pixel-wide photo in a 1,200-pixel column is mostly wasted data, so resize it first.
A simple decision guide
- Photo, for email or an upload form? JPG.
- Photo, for your own website? WebP, or AVIF with a fallback.
- Screenshot, or a graphic with text? PNG, or lossless WebP on a website.
- Logo or icon? SVG if you have a vector version, otherwise PNG.
- Needs transparency? PNG or WebP.
- Archiving or editing? A lossless format, or your original files.
If you need to switch, the image converter handles the common formats in your browser, and PNG to JPG covers the most frequent case. Your images aren't uploaded anywhere.