People want a single word, and there is one — it just depends on something first. The right format is decided entirely by what is in the image, because these two are good at opposite things.
Here is the answer, and then the reason, which is worth two minutes because it means never having to look it up again.
The short version
| What the image is | Use | Why |
|---|---|---|
| A photograph | JPG | Five to ten times smaller, and you cannot see the difference |
| A screenshot, or anything with text | PNG | JPG blurs every letter edge, and is often bigger anyway |
| A logo or icon with a transparent background | PNG | JPG cannot store transparency at all |
| A chart, diagram or flat illustration | PNG | Flat colour compresses beautifully and stays sharp |
| A photo you are still editing | PNG now, JPG at the end | Every JPG save loses a little more |
They compress in opposite directions
JPEG throws detail away. It works by smoothing — it discards the fine, high-frequency detail the eye is worst at noticing, and reconstructs an approximation when the file is opened. That is why it is called lossy, and why the file is small.
PNG throws nothing away. It compresses by finding repetition: runs of identical pixels, patterns that recur, rows that resemble the row above. What comes out is bit-for-bit what went in.
Now send a photograph through both. A photograph is essentially noise — no two neighbouring pixels are quite the same, so PNG finds almost nothing to compress and the file stays enormous. JPEG’s smoothing, meanwhile, is invisible on a face or a sky. JPG wins, by a wide margin.
Now send a screenshot through both. Flat backgrounds, repeated pixels, hard black-on-white text. PNG compresses that superbly. JPEG’s smoothing lands on every letter edge and leaves a faint grey halo around it. PNG wins, and it is usually the smaller file too.
Same two formats, opposite verdicts, and the only thing that changed was the content.
Transparency settles itself
JPG has no way to record “nothing here”. Every pixel in a JPG has a colour, so a transparent background has to become something — and left alone it becomes black, because to a decoder that has not been told otherwise, no light is black. That is why a logo converted carelessly comes back sitting on a black rectangle.
If the transparency has to survive, the decision is already made. If it does not — the image will sit on a white page forever — then converting to JPG with the transparent parts filled in a colour you pick is perfectly sensible, and much smaller.
The myth worth killing: PNG is not “higher quality”
PNG is lossless, which is a different claim, and the difference matters.
Lossless means it loses nothing relative to what you hand it. Hand a PNG encoder a JPG that has already been compressed half to death and you get a perfect, enormous, lossless copy of a damaged picture.
Converting JPG to PNG is genuinely useful — it stops any further loss while you edit, and it gives you transparency to work with. What it cannot do is recover a single pixel the JPG already discarded. Nothing can. If somebody tells you a converter improves quality, they are describing something that is not possible.
Generation loss, and why it matters more than the first save
One JPG save at a sensible quality is invisible. The problem is that pictures are rarely saved once.
Open it, crop it, save. Send it to somebody who adds text and saves again. They send it on, it gets resized, saved. Each re-encode compresses the previous compression’s artefacts along with the picture, and by the fifth generation it looks like it was faxed. This is the single most common way images are ruined, and no individual step looks like the culprit.
PNG has no such problem — re-save it a hundred times and it is identical to the first.
Which gives the working rule most people reach eventually: edit in PNG, publish in JPG. Keep the lossless copy as the master, and export a JPG each time you need to send one. The next edit starts from the master, not from the copy.
Why your PNG is enormous
Three usual causes, in order of how often they turn out to be it:
- It is a photograph. PNG has nothing to work with, so the file is close to raw. This is not a fault to fix; it is the wrong format for the job.
- It stores far more colour than it uses. A PNG can carry a full colour range per pixel, or a palette of up to 256 colours. A flat logo might use six. Exported as a palette PNG rather than a full-colour one, the same image is often a small fraction of the size, pixel for pixel identical.
- It is much bigger than it will ever be shown. A 4000-pixel PNG displayed in a 600-pixel column is storing detail nobody will ever see. Resizing it to the size it is actually displayed at is the first and largest saving, and it costs nothing visible.
If the format has to stay and the file still has to come down, compressing on purpose beats letting an upload form decide for you — you get to look at the result before you commit to it.
Where WebP fits
There is a third answer, and for a website it is usually the right one.
WebP does both jobs: a lossy mode that beats JPEG and a lossless mode that beats PNG, keeping transparency in either. The figures usually quoted are around a quarter to a third smaller than the equivalent JPG or PNG at the same visible quality, which on a page full of images is the difference between fast and slow.
Every current browser reads it. The catch is everything that is not a browser — some desktop software, some upload forms, some older phones still refuse it. So: WebP for a site you control, JPG or PNG for a file you are handing to somebody else.
And for printing?
For a photograph going to print, a high-quality JPG has always been fine. What matters far more than the format is the resolution — 300 dpi at the size it will be printed, which is a property of the original and cannot be added afterwards.
For anything with text or line art — a poster, a certificate, a diagram — use PNG. Print shows the halo around letters that a screen forgives.
The rule that covers nearly everything
Does the image have hard edges or transparency?
If yes, PNG. If no, JPG. Everything above this line is just the explanation for that one question.