PNG vs JPG: which image format should you use?

Use JPG for photographs and PNG for anything with sharp edges, flat colour, text or transparency: screenshots, logos, diagrams, icons and pixel art. JPEG throws away detail your eye is unlikely to miss, which makes photos small; PNG keeps every pixel exactly, which keeps graphics crisp but makes photos large. I built the PNG to JPG converter and its reverse for the moments when you have the wrong one, and this guide explains what actually differs between the two.

How PNG stores an image

PNG is lossless. Each row of pixels is first passed through a simple prediction filter, for example storing each pixel as its difference from the one to its left, and the result is compressed with DEFLATE, the same algorithm used inside ZIP files. Decoding reverses both steps and returns identical pixels, however many times you open and re-save the file. That works brilliantly on large areas of one colour and on repeated patterns, which is why a screenshot of a text document can be tiny, and poorly on the random-looking texture of a photograph, where there is little repetition to exploit.

PNG also supports an alpha channel: each pixel can be anything from fully transparent to fully opaque, so a logo can sit cleanly on any background with soft, smooth edges. The format can store up to 16 bits per channel, and it has an indexed mode with a palette of up to 256 colours that makes simple graphics smaller still.

How JPEG stores an image

JPEG is lossy. The encoder converts the picture into one brightness channel and two colour channels, usually stores the colour at reduced resolution, splits the image into 8ร—8 blocks and keeps a rounded-off description of each block, discarding more fine detail the lower the quality setting. On a photo the loss is hard to see at quality 80 to 90, and the file is a fraction of the PNG size. On text and hard edges it shows up as smudgy halos and blocky noise, the artefacts explained in How JPEG compression works โ€” and what the quality slider really does. JPEG has no transparency at all: every pixel is opaque. And because each save runs the lossy step again, editing and re-saving the same JPEG many times slowly degrades it.

Which to use when

  • Photographs, including product shots and scanned pictures: JPG.
  • Screenshots of apps, documents and code: PNG, so the text stays sharp.
  • Logos, icons and diagrams with flat colour: PNG, or SVG if you have the vector original.
  • Anything that needs a transparent background: PNG.
  • Pixel art: PNG, always, because JPEG smears the hard pixel edges.
  • Master copies you will keep editing: PNG or your editor's own format, exporting a JPG only at the end.
  • Email attachments and upload limits: JPG, unless the image is mostly text.

A quick test that rarely fails: if the image came from a camera, start with JPG; if it came from a screen or a drawing program, start with PNG.

Converting between them

Converting PNG to JPG is a decision about what to lose. The PNG to JPG converter redraws each image on a canvas and re-encodes it at a quality you choose between 50 and 100 percent, with 90 as the default. Because JPEG cannot be transparent, any see-through areas are filled with a background colour you pick. White suits most documents, but a logo headed for a dark website needs that dark colour instead, or it will arrive sitting in a white box. Several files at once come back as a ZIP, and everything happens in your browser without an upload.

Going the other way, the JPG to PNG converter is useful when a form demands PNG, or when you are about to edit an image several times and want to stop the losses piling up. It cannot restore what JPEG already discarded: the PNG looks identical to the JPG, artefacts included, and is usually several times larger. If what you actually want is a smaller file, the image compressor is the right tool.

What about WebP and AVIF?

PNG and JPG are no longer the only choices. WebP and AVIF can each work lossily like JPEG or losslessly like PNG, both support transparency, and both usually produce smaller files than the older formats at similar visual quality. Every current major browser displays them, so they are a good fit for images on your own website. They are less universally accepted elsewhere: some upload forms, older software and print services still expect JPG or PNG. The WebP converter turns images into WebP and back again, and AVIF vs WebP vs JPEG: sizes, support and when to use each compares the newer formats in detail. For sharing and compatibility, the old rule still holds: JPG for photos, PNG for graphics.

Sources and further reading

The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.

  1. Portable Network Graphics โ€” Wikipedia (DEFLATE, filtering, alpha)
  2. JPEG โ€” Wikipedia (lossy DCT compression)
  3. Image file type and format guide โ€” MDN Web Docs

Try the tool

Frequently asked questions

Is PNG better quality than JPG?

PNG is lossless, so it keeps every pixel exactly, while JPG discards some detail. For photos the difference is usually invisible at high JPG quality, so PNG is clearly better only for text, sharp edges and transparency.

Does converting JPG to PNG improve quality?

No. The PNG keeps exactly what the JPG contained, including its artefacts, and is usually a much larger file.

Why did my transparent PNG get a white background?

JPG has no transparency, so converters fill see-through areas with a solid colour, usually white. Keep the image as PNG, or choose a background colour that matches where it will be shown.

Which is smaller, PNG or JPG?

For photographs JPG is far smaller. For screenshots and flat graphics a PNG is often both smaller and sharper.