JPEG vs PNG: Which Image Format Should You Use and When?
JPEG vs PNG compared: JPEG gives small files for photos, PNG gives exact pixels and transparency for graphics. See file size, quality and when to use each.
Updated
Use JPEG for photographs and PNG for graphics. JPEG compresses photos into small files by discarding detail the eye rarely notices, but it has no transparency and it blurs sharp edges. PNG stores every pixel exactly and supports transparent backgrounds, which makes it the right choice for logos, screenshots, icons and anything with text, at the cost of much larger files for photos.
JPEG vs PNG at a glance
| JPEG | PNG | |
|---|---|---|
| Compression | Lossy | Lossless |
| Transparency | No | Yes, full alpha channel |
| Colors | 16.7 million (24-bit) | 256-color palette up to 16.7 million, plus alpha |
| Best for | Photos, complex images with smooth tones | Logos, screenshots, text, line art, flat color |
| Weakness | Artifacts around sharp edges, loss on each re-save | Large files for photographic content |
| Quality setting | Yes, 0 to 100 | No, always exact |
| Extensions | .jpg, .jpeg | .png |
| Standardized | 1992 | 1996 |
Both formats open in every browser, operating system and image editor, so compatibility never decides between them.
How JPEG works, and where it fails
JPEG splits an image into blocks of 8 by 8 pixels and describes each block as a combination of smooth patterns. It then stores the fine detail in those patterns less precisely, and usually stores color at a lower resolution than brightness. The quality setting controls how much is thrown away.
Photographs suit this well. They are full of gradual changes in tone, and the lost detail is hard to see. A JPEG at quality 80 to 85 is usually indistinguishable from the original at normal viewing size.
It fails on hard edges. Text, thin lines and flat color next to a sharp boundary pick up smudges and faint halos, often called ringing or mosquito noise. Red text on a dark background is a common worst case, because of the reduced color resolution. Large areas of one flat color can also show faint block patterns at low quality.
JPEG also degrades with each save. Opening a JPEG, editing it and saving it again runs the lossy step a second time. After several rounds the damage becomes visible. Keep an original and export from it.
How PNG works, and where it fails
PNG never changes a pixel. It predicts each pixel from its neighbors, stores the difference, and compresses the result with the same family of algorithm used in ZIP files. Open and save a PNG a hundred times and it is identical.
This works extremely well on images with repetition: flat backgrounds, interface elements, diagrams, pixel art. A screenshot of a text document can be smaller as a PNG than as a JPEG and look perfect.
It works poorly on photos. Camera noise and natural texture are close to random at the pixel level, and random data does not compress. A 12 megapixel photo holds about 36 MB of raw pixel data. As a JPEG it is typically a few megabytes. As a PNG it is commonly several times that, with nothing visible gained.
Transparency
This is often the deciding factor. PNG supports an alpha channel with 256 levels of opacity per pixel, so a logo can have soft, anti-aliased edges and sit cleanly on any background color. JPEG has no transparency of any kind.
If you convert a transparent PNG to JPEG, the transparent areas must become some color. Most tools use white. A logo placed on a dark page then shows up inside a white rectangle. If you need both small photographic files and transparency, neither format fits and WebP is the answer, covered in WebP vs PNG vs JPG.
File size in practice
Rough expectations for the same image saved both ways:
| Image type | Smaller as | Why |
|---|---|---|
| Camera photo | JPEG, by a wide margin | Noise and texture defeat lossless compression |
| Screenshot of an app or document | PNG, usually | Flat areas and sharp text compress losslessly and stay crisp |
| Logo with a few flat colors | PNG | Few colors, hard edges, often needs transparency |
| Screenshot of a video or game | JPEG | The content is photographic even though it is a screenshot |
| Chart or diagram | PNG | Thin lines and labels show JPEG artifacts |
| Scanned document | Depends | PNG for clean black and white, JPEG for color scans |
When a PNG is too large and has to stay a PNG, reducing its pixel dimensions is the dependable fix. Halving the width and height removes three quarters of the pixels.
JPG vs JPEG: the naming question
JPG and JPEG are the same format. The name comes from the Joint Photographic Experts Group, the committee that wrote the standard. Early Windows and DOS systems limited file extensions to three characters, so .jpeg was shortened to .jpg, and both have been in use ever since. The file contents are identical, and renaming photo.jpeg to photo.jpg changes nothing. The same goes for the less common .jpe and .jfif extensions.
Which one to use
- Photo for a website, email or social post: JPEG.
- Logo, icon or illustration with flat color: PNG, or SVG if you have the vector source. See SVG vs PNG.
- Anything that needs a transparent background: PNG.
- Screenshot with text: PNG.
- An image you will edit again: PNG, or keep the original file, so no quality is lost between saves.
- Product photo on a transparent background: PNG works but is heavy. WebP is a better fit.
- Print: follow the printer's specification, which is often a high-quality JPEG, TIFF or PDF.
For most websites the real question today is whether to use either one. WebP and AVIF do both jobs in smaller files, and the wider field is compared in image file formats.
Converting between them
Converting PNG to JPEG makes sense when someone saved a photo as PNG. Converting JPEG to PNG never improves quality. The detail JPEG discarded is gone, and the PNG faithfully stores the artifacts in a larger file. The only reasons to do it are to stop further loss during editing or to satisfy an upload form.
The Image Compressor converts in both directions. Drop in a PNG, choose JPEG as the output format, and adjust the quality slider while comparing the before and after preview. Transparent areas are filled with white in JPEG output. Choose PNG output instead to re-pack a PNG losslessly. It handles batches and downloads them as a ZIP.
To move either format to something smaller for the web, the WebP Converter takes PNG and JPG files, converts them to WebP with a quality slider, and shows the size saving for each file. Transparency carries over. If an image is simply too many pixels, set exact dimensions in the Image Resizer, which exports PNG, JPEG or WebP.
For choosing a quality number and a sensible order of steps, see how to compress images without losing quality.
Try it
Drop a photo that was saved as PNG into the Image Compressor, switch the output to JPEG at quality 80, and compare the file sizes. Then try the same with a screenshot of text and look at the edges of the letters to see why PNG exists.