PNG vs JPG

JPG for photographs, PNG for anything with text, sharp edges or transparency.

Choose PNG when

Screenshots, logos, diagrams, line art and anything that has to keep a transparent background. PNG stores every pixel exactly, so text stays crisp and a cut-out stays cut out.

Choose JPG when

Photographs, and anything that looks like one — soft gradients, no hard edges. JPG throws away detail the eye is poor at noticing, which on a photograph is close to free and typically saves ninety per cent.

The thing that catches people out

JPG has no transparency at all. A PNG with a transparent background becomes a JPG with a solid one, usually white or black, and no setting brings it back.

What PNG to JPG actually does

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as PNG.

PNG139 KB

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as JPG.

JPG9 KB15.9× smaller

A photographic scene — smooth gradients, soft edges, grain. This is the case JPG is designed for or against, and the figures show which. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as PNG.

PNG7 KB

A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as JPG.

JPG6 KB18% smaller

A transparent background and a gradient across the shape. JPG either keeps both, keeps one, or fills the transparency with a solid colour — which is the difference that catches people out. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as PNG.

PNG3 KB

A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as JPG.

JPG16 KB6.3× larger

Flat colour and hard edges, as in an interface, a chart or a logo. Very different behaviour from the photograph above, and the reason the answer is "it depends what is in the file". Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.

Side by side

PNGJPG
Full namePortable Network GraphicsJPEG Image
Extension.png.jpg, .jpeg, .jpe
Media typeimage/pngimage/jpeg
CompressionLossless — nothing is discardedLossy — file size is bought with quality
This site can write itYesYes

Decided? Convert it here

Where these figures come from

The claims this page makes about PNG and JPG are checkable, and these are the documents that settle them.