Stuck on png vs jpg? It comes down to what your image shows. Use PNG for sharp artwork and transparency, and JPG for photographs where small files matter most.
If you want the wider background first, start with our guide to the png file format.
| Item | Value |
|---|---|
| PNG compression type | Lossless |
| Indexed-color PNG palette limit | 256 colors |
| Truecolor PNG range | Up to 16 million colors |
| PNG alpha transparency levels | 0 (fully transparent) to 255 (fully opaque) |
| PNG for photographic content | Almost never the right choice |
These figures come from web.dev’s PNG guide, last updated in February 2023. Formats, browsers and tools change, so check the source before you rely on them.
How PNG and JPG differ in practice
The core split is how each format treats your pixels. According to web.dev, PNG uses lossless compression, so the image data is compressed without any loss of visual fidelity. JPG, by contrast, is a lossy format: it gives up some detail in return for smaller files.
Transparency is the second big difference. PNG supports alpha channel transparency, so each pixel can be set to a level of transparency between 0 (fully transparent) and 255 (fully opaque), as web.dev explains. That is what lets a logo carry a soft drop shadow and still sit cleanly on any background.
Colour depth is the third. An indexed-color PNG uses a palette limited to 256 colors, while the far more common truecolor PNG can hold up to 16 million colors, per web.dev.
What PNG does well
PNG earns its place when exact pixels matter more than file size. These are the situations where it shines:
- Lossless storage: saving an image as a PNG will never result in a drop in visual quality.
- Semi-transparency: logos and simple artwork with soft edges or shadows.
- Master copies: a manageable-sized “canonical” version you keep in a project, in case the image must be edited or re-saved in other formats later.
The quality and master-copy points are from web.dev’s PNG guide. PNG started life as a replacement for GIF, and if animation or tiny palettes are on your mind, our comparison of png vs gif is the next stop.
Where PNG falls short against JPG
Lossless quality has a price, and the price is size. web.dev says this almost invariably results in excessively large file sizes compared to more modern web-friendly encodings. Because of that transfer size, PNG is almost never the right choice for photographic content.
Flat graphics are not always safe ground either. The same guide notes that PNG solves use cases that are frequently better served by SVG, both for scalability and for file size.
Finally, not every PNG is built equally. Encodings are standardized, yet different editing tools perform them with different efficiency, which is why web.dev recommends running files through a tool like Squoosh or ImageOptim before transferring them.
Quality: does PNG look better than JPG?
In one narrow sense, yes. A PNG keeps every detail you gave it, while a lossy JPG discards some. For a photograph, though, that extra fidelity is rarely visible enough to justify the heavier file.
The better question is what your image needs to survive. Sharp text, flat color and clean edges reward lossless storage, whereas busy photographic detail is where a lossy format saves the most space for the least visible cost.

If you ever hand a PNG to someone and they cannot view it, our guide on how to open a png file covers the common ways in.
When to use each format
As of the February 2023 update of web.dev’s guide, PNG should only be considered for simple artwork that requires semi-transparency, such as a company logo containing a drop shadow. It should also be compared carefully with newer formats that support semi-transparency, such as WebP.
Choose PNG when
- The image is a logo, icon or simple graphic.
- You need soft or partial transparency.
- You want a lossless master you can re-export later.
Choose JPG when
- The image is a photograph.
- Small transfer size matters more than perfect fidelity.
- You do not need transparency.
When in doubt, test both. Export the image each way, compare the results by eye, and keep whichever looks right at the smaller size.
Frequently asked questions
Is PNG or JPG better for photos?
Show answer
JPG is the usual pick. A lossless PNG of a photo tends to be heavy, and web.dev’s guide treats photographic content as a poor fit for PNG.
Does PNG support transparency?
Show answer
Yes, and with finer control than GIF. GIF treats transparency as a binary choice, where a pixel is either an opaque color or fully transparent, while PNG allows levels in between (source).
Should I use PNG for a logo?
Show answer
It can work, particularly when the logo has a soft shadow that needs partial transparency. Vector artwork is often better served by SVG, so compare the two before you commit.
Can I make a PNG file smaller?
Show answer
Yes. Passing it through an optimizer such as Squoosh or ImageOptim is the route web.dev suggests, since editing tools differ in how efficiently they encode.



