JPG vs PNG
One throws away detail to get small, the other keeps every pixel exactly. Which is right depends on whether your image is a photograph or a graphic.
The difference in one line: JPG throws away detail to make the file small. PNG keeps every pixel exactly and accepts a larger file.
Everything else follows from that, including which one you should use.
The rule that covers most cases
Photographs → JPG. Everything else → PNG.
That single rule gets it right the overwhelming majority of the time, and the reasoning is worth understanding because it explains the exceptions.
Why JPG suits photographs
JPG is lossy. It analyses the image, decides which detail the human eye is least likely to notice, and discards it. In a photograph — where colour varies continuously and there is natural noise everywhere — there is a great deal the eye will not miss. A photo saved as JPG at 70% quality is often a tenth the size of the PNG and visually identical on screen.
The same behaviour destroys graphics. JPG works on blocks of pixels, and it produces its worst artefacts exactly where colour changes sharply — the edge of a letter, the border of a button, a line on a chart. Save a screenshot as JPG and you get a fuzzy halo around every character.
Why PNG suits graphics
PNG is lossless. Every pixel comes back exactly as it went in, no matter how many times you save it. For logos, screenshots, diagrams, charts and anything with text, that is essential.
PNG also compresses flat areas of identical colour extremely well — which is precisely what a screenshot or a logo consists of. A simple logo as PNG can be smaller than the same logo as JPG, while also being sharp.
Transparency: only PNG has it
JPG has no concept of a transparent pixel. If your image needs to sit on top of a coloured background without a white box around it, PNG is the only choice between the two.
This alone decides a great many cases. Logos, icons and anything overlaid on a page generally has to be PNG regardless of what else is true.
Repeated saving
Every time you save a JPG, it re-compresses — including the parts already degraded by the last save. Open, edit, save, repeat, and the image visibly deteriorates. This is why you keep an original and export copies rather than editing the JPG in place.
PNG has no such problem. A hundred saves produce a hundred identical files.
What about WebP and AVIF?
Both are newer, both compress better than either format here, and both are supported by every current browser. For images on a website, WebP is usually the better choice — smaller than JPG at the same quality, and it supports transparency.
The reason JPG and PNG persist is universal support outside the browser: email clients, older software, print shops, and anything that has not been updated in a decade. For a file you are sending to a person rather than serving on a page, the older format is still the safer one.
Quick reference
| JPG | PNG | |
|---|---|---|
| Photographs | Yes | Larger, no benefit |
| Screenshots, text, logos | Fuzzy edges | Yes |
| Transparency | No | Yes |
| Repeated saving | Degrades | Safe |
| Typical photo size | Small | 5–10× larger |
If you need a photo under a specific size limit, compress it to that target rather than guessing at a quality setting.