JPG vs PNG: which should you use?

A direct answer, a property comparison, measured file sizes and when to pick each format.

Short answer: JPG or PNG?

Use JPG for photographs and other images with smooth gradients, where a small file matters more than a few discarded details. Use PNG for screenshots, logos, diagrams, text and anything that needs a transparent background or must stay pixel-exact. Converting a PNG photo to JPG usually shrinks it a lot; converting a JPG to PNG does not bring back detail the JPG already lost.

JPG and PNG compared

PropertyJPGPNG
CompressionLossyLossless
TransparencyNoYes
AnimationNoNo
File extensions.jpg, .jpeg, .jpe, .jfif.png
MIME typesimage/jpegimage/png
Developed byJoint Photographic Experts GroupPNG Development Group
First released19921996
What opens itJPEG opens in every web browser, in Windows Photos, macOS Preview, the photo apps of iOS and Android, and in editors such as Photoshop and GIMP.PNG opens in every web browser and image viewer, in Windows Photos, macOS Preview, and in editors from Paint to Photoshop and GIMP.

Measured file sizes

These are file sizes we measured with NexMedia's own conversion engines, not estimates. In our test of 4 images, every file was converted at NexMedia's default settings, and each cell is the size of the file the converter produced.

Output size of each sample image
SamplePNG source fileJPG (default settings)PNG (default settings)
Photograph A (Kodak test set)503 kB54.6 kB642 kB
Photograph B (Kodak test set)558 kB50.9 kB866 kB
Screenshot of a web application37.2 kB34.3 kB39.6 kB
Flat-colour cartoon illustration269 kB17.6 kB360 kB
All samples together1.37 MB157 kB1.91 MB

Across all 4 images together, PNG (default settings) came to 1,211% of the size of JPG (default settings).

PNG (default settings) was smaller than JPG (default settings) for 0 of the 4 images.

The samples

How this was measured

Engines: libvips 8.14.1 for images and ffmpeg 5.1.9-0+deb12u1 for audio and video, the builds inside NexMedia's conversion worker image. Measured on November 12, 2026.

Image settings were NexMedia's defaults: quality 82, with the lossless option off except where a column says lossless mode. The PNG column is a PNG written by NexMedia's converter (the source PNG went through a lossless TIFF step first), so it reflects NexMedia's PNG encoder rather than the tool that made the original file.

Progressive (interlaced) output is on by default, which typically makes PNG files larger than the same pixels saved without interlacing.

Quality is not measured here. A smaller file is not a better file: encoders trade size against detail differently, and the same quality number means different things in different codecs. Only lossless and uncompressed outputs keep every detail of the data they were given.

Results depend on the content of each file, so other files can give different sizes. Treat these numbers as one reproducible test, not as a rule.

When to choose which

  • Photos to share or upload

    JPG is the usual choice: files are small, and every phone, browser and service accepts them. Some detail is discarded each time a JPG is saved again, so keep an original if you plan to edit.

  • Screenshots, logos and text

    PNG stores every pixel exactly, so edges and text stay sharp. JPG adds visible smudges around hard edges, and it can make flat-colour graphics larger than a PNG.

  • Transparent backgrounds

    Only PNG keeps transparency. JPG has no transparent pixels, so converting a transparent PNG to JPG fills the background with a solid colour (NexMedia uses white by default).

  • Editing and archiving

    PNG is lossless, so it is a safe working format for images you will edit or save several times. Use JPG for the final copy you publish.

The formats

Convert between them

Converter and compression tools

More comparison guides

Frequently asked questions

Is PNG higher quality than JPG?

PNG is lossless, so it keeps every pixel of the image it was given, while JPG discards detail to save space. That makes PNG exact, not automatically better looking: a JPG saved at a high quality setting can be hard to tell apart from the original, at a much smaller size for a photograph.

Why is my PNG so much larger than the same picture as a JPG?

PNG compresses without discarding anything, which works well for flat areas and poorly for the noisy, detailed texture of photographs. The measured section above shows the difference for our samples.

Does converting JPG to PNG improve quality?

No. A PNG made from a JPG contains the same pixels, including the JPG's artefacts, and is usually larger. It is useful only when a program needs PNG or a transparent background.

What happens to transparency when I convert PNG to JPG?

JPG cannot store transparency, so the transparent areas are filled with a solid background colour. NexMedia's converter uses white unless you set a different background colour in the options.