PNG vs JPEG
Both store photographs, but they make different trade-offs. Here is where they actually differ, and how to pick.
Short answer
This is not a quality-versus-size choice. It is a content-type choice: photographs belong in JPEG, and text, lines, and flat colour belong in PNG.
Why this comes up
This is the oldest comparison on the web and the one most often answered badly. The common shorthand — "PNG is higher quality, JPEG is smaller" — is not wrong exactly, but it leads people to the wrong file constantly: a 6 MB PNG of a holiday photo, or a JPEG of a screenshot with grey fuzz around every letter. The useful rule has nothing to do with quality settings and everything to do with what is in the picture.
Side by side
| Property | PNG | JPEG |
|---|---|---|
| Compression | Lossless | Lossy |
| Transparency | Yes | No |
| Typical file size | 300-500% of an equivalent JPEG | 100% of an equivalent JPEG |
| Compatibility | Opens everywhere, including decades-old software | Opens everywhere, including decades-old software |
| Usually comes from | Screenshots, logos and graphics | Digital cameras and photo sharing |
What actually differs
They compress by opposite mechanisms
JPEG throws away detail your eye is bad at noticing — mostly fine colour variation and high-frequency noise — and it does this well on the continuous gradients that make up a photograph. PNG throws away nothing and instead looks for exact repetition along rows of pixels, which is abundant in a screenshot and nearly absent in a photo. Give each the content it was designed for and both produce small files. Swap them and both produce bad ones.
Only PNG survives repeated saves
Every time a JPEG is opened, edited and saved again, it is re-compressed and loses a little more. Do it a dozen times and blocky artefacts appear around edges. PNG is byte-identical no matter how many round trips you make. If a file is a working document rather than a finished deliverable, this alone settles the question.
Transparency exists in PNG only
JPEG has no alpha channel. Converting a transparent PNG to JPEG does not produce a transparent JPEG — it fills the transparent region with a solid colour, typically white or black depending on the tool. Logos are the usual casualty: a crisp mark on transparency becomes a mark on a white rectangle that then sits visibly on any coloured background.
Which to use
Use PNG for
Screenshots containing text, logos, icons, diagrams, line art, anything needing transparency, and any file you will edit again later.
Use JPEG for
Photographs and photographic renders, where PNG offers no visible benefit and costs three to five times the bytes.
One thing that catches people out
A screenshot of a photograph is a photograph
The "screenshots go in PNG" rule tracks content, not how the file was produced. Screenshot a full-screen photo, a video frame or a map with satellite imagery and you have captured continuous-tone data. PNG will store that at several megabytes for no benefit. Look at what is actually in the frame, not at which key you pressed to capture it.