JPG vs PNG vs WebP: which format to use
A practical comparison of JPG, PNG and WebP for real projects — transparency, sharp edges, quality settings and file size — with a simple decision rule you can reuse.
Format choices are usually made by habit. Someone exports everything as PNG because it sounds higher quality, or everything as JPG because that is what the camera produces. Neither habit survives contact with a real project, where a logo, a screenshot and a photograph have almost nothing in common. Looking at what each format is built to do makes the decision much easier.

What each format is good at
JPG is a lossy format designed for photographs. It throws away detail that the eye is unlikely to notice, which is why a photo can shrink from several megabytes to a few hundred kilobytes while still looking right. It has no concept of transparency. Every pixel must be fully opaque, and anything transparent in the source is flattened against a background colour.
PNG is lossless and supports an alpha channel. It stores the image exactly, which makes it the natural home for flat-colour graphics, line art, screenshots with text, and anything with transparent edges. The cost is size. A continuous-tone photograph saved as PNG can easily be five to ten times larger than the same picture as JPG, with no visible benefit at all.
WebP sits between them in a useful way. It supports both lossy and lossless encoding and handles transparency, so it can do almost everything JPG and PNG do in one file. At comparable visual quality it is usually smaller than JPG, and it keeps alpha without the PNG size penalty. The trade-off is that very old software and a few niche upload systems still do not read it, so compatibility has to be checked before committing.
Transparency is the first decision
Ask whether the image needs to show whatever is behind it. A logo on a coloured banner, a cut-out product shot, a circular avatar that should reveal the page background — all of these need alpha. That removes JPG from the list immediately. The choice is then PNG or WebP, with WebP usually producing the smaller file.
If the image does not need transparency, JPG or WebP is almost always better than PNG. When converting a transparent PNG to JPG, you must choose a flatten colour. White is the default and is fine for documents and product photos on light pages, but it will look wrong on a dark interface. Pick a colour that matches where the image will actually sit. This is also why a circle crop should be exported as PNG or WebP: a JPG cannot keep the transparent corners, so the circle turns into a rectangle with a coloured frame.
Sharp edges, text and small graphics
Lossy compression works by simplifying areas of an image. That is fine for foliage and skin, but it is rough on crisp edges and single-pixel lines. A screenshot full of interface text, a diagram with thin rules, or a logo with hard geometric corners will look cleaner as PNG. The OxiPNG encoder keeps those edges exact, and the file is typically small because flat-colour graphics compress well even without lossy tricks.
The same logic applies to images you plan to edit again. Each lossy save compounds the previous damage slightly. Keep a lossless master for anything you expect to revisit, and produce JPG or WebP only as a final delivery copy.
Quality numbers and what they mean
For JPG and WebP, quality values around 75 to 85 cover most web images. Below roughly 70, blocking appears around high-contrast edges and fine texture begins to disappear. Above 90 the file grows quickly while the visible improvement becomes almost impossible to spot at normal viewing size. The right test is a full-size comparison of the same frame, not a glance at a thumbnail.
PNG is different. Because it is lossless, a quality slider does not apply in the same way. If you need a smaller PNG, reduce the number of colours or the pixel dimensions instead. That distinction matters when a workflow asks for “80 percent PNG” — the request does not really make sense, and the file will not shrink the way the person expects.
Conversion is not repair
This is the most misunderstood part of format work. Converting a JPG to PNG does not bring back detail that JPG discarded. It simply stores the already-damaged pixels losslessly, producing a larger file of the same picture. The same applies to repeated conversions between formats: every lossy round adds a little more blur and blocking.
Good practice is to convert once, from the best available master, and to do it after other adjustments. If you plan to resize, crop and then convert, put conversion last so the encoder works on the final pixel grid. The format converter handles PNG, JPG and WebP with real encoder control, and the resizing tool can prepare the dimensions before you export. Everything runs in the browser, so iterating does not mean uploading copies of a client file.
A decision rule you can reuse
Start with transparency. If it is needed, choose WebP for delivery where supported and PNG where compatibility matters most. If it is not needed, ask whether the image is photographic or graphic. Photographs go to JPG or WebP at a quality in the mid-70s to mid-80s. Graphics, text and line art go to PNG. Then check the destination: an old upload form or an unfamiliar CMS may only accept JPG and PNG, which overrides the preference for WebP.
When in doubt, export two versions and compare them at full size. The smaller one wins unless you can point to a specific detail that looks worse. That test beats any rule of thumb.
Mistakes worth avoiding
Converting a photo to PNG to preserve quality. It preserves the pixels you already have at a much higher byte cost.
Leaving transparency in a JPG export. It gets flattened, often to white, and the result surprises people on dark backgrounds.
Re-encoding the same file repeatedly. Work from the original each time instead of from the previous export.
Assuming one format for a whole page. A page with a hero photo, a transparent logo and a text screenshot legitimately needs three different answers.
Format choice is a small decision with an outsized effect on load time and appearance. Once you sort by transparency, then by photographic versus graphic content, then by what the destination accepts, the answer is usually obvious. More hands-on comparisons are collected in the guide index.