Skip to content
Tejo Tools
Search
Menu

JPG, PNG or WebP: which image format to use

See what each format is made for, and what changes when you convert a picture from one to another.

Last updated

Open Image converter

Three formats, three ways of storing pixels

An image file is a grid of coloured pixels written down in a compact way. JPG, PNG and WebP write that grid down differently, and the difference decides both the size of the file and what survives in it.

  • JPG dates from the early 1990s and is lossy: it keeps the broad shapes and colours of a picture and rounds away fine detail, by an amount set by its quality number. It handles photos well and is opened by practically every camera, phone, program and website. It has no way to store transparent areas.
  • PNG is lossless: every pixel comes back exactly as it was saved. That makes it good at screenshots, diagrams, logos and anything with text or hard edges, and poor at photos, where keeping every grain of noise makes the file large. PNG can store transparency, down to partly see-through edges.
  • WebP came from Google in 2010 and can work either way, lossy or lossless. Saved lossy, a photo usually comes out smaller than a JPG of similar look. It keeps transparency in both modes. Current browsers show it, but some older programs, printers and upload forms still refuse it. No format is better in every case. The question is what the picture contains and where it is going.

Transparency, and which formats keep it

Transparency is a fourth value stored with each pixel beside red, green and blue. It says how much of whatever lies behind the picture shows through, from fully covered to fully see-through. A logo cut out from its background, an icon with round corners or a signature on nothing all rely on it. PNG and WebP store that value. JPG doesn’t, so when a picture with transparent areas is saved as a JPG, something has to fill those areas. Image converter paints white under the picture by default, and black when you pick Black under Background for transparent areas. Once the file is a JPG the fill is part of the picture, and converting it back to PNG brings back a white or black square, not the cut-out. The same holds in reverse for any lossy step: converting a JPG to PNG keeps the JPG’s rounding exactly, marks and all, in a larger file. Converting never adds detail that a file has already lost.

Worked examples

These use the two sample files of the image converter: sunset.png, a photo-like picture of 960 × 640 px and 167.6 KB, and logo.png, a flat-colour logo of 480 × 240 px and 5.0 KB with transparent corners. The tool’s Try a sample button loads the pair. Sizes are rounded as the file cards show them, at the tool’s default Quality of 90.

A photo-like PNG to JPG and WebP

Converted to JPG, sunset.png becomes sunset.jpg of about 38.3 KB, 77% smaller than the PNG. Converted to WebP it is about 17.4 KB, 90% smaller, and less than half the size of the JPG. Both copies are still 960 × 640 px. Gradients and soft colour are what lossy formats store compactly, so a picture like this one shrinks a great deal when it leaves PNG.

A logo with transparent corners

Converted to JPG, logo.png becomes logo.jpg of about 11.6 KB, 133% larger than the PNG, and its transparent corners are now white. Converted to WebP it is about 6.5 KB, 30% larger, and its corners stay transparent. A flat logo with a few colours is exactly what PNG stores well, so here the lossy formats come out bigger, and only WebP keeps the cut-out.

What each format is commonly used for

The two examples line up with how the formats tend to be used:

  • Photos sent by email, shared or uploaded to forms are mostly JPG, the format nearly every site and app takes. WebP makes a smaller file wherever it is accepted.
  • Photos on web pages are often WebP as well as JPG, since current browsers show both.
  • Screenshots, charts, logos and scans of text are usually PNG, which keeps letters and lines sharp and, for pictures like these, often makes the smaller file too.
  • Pictures with a transparent background are PNG or WebP, because a JPG fills the background in. When a form names one format only, that requirement settles it, whatever the picture holds.

What the converter changes, and what it keeps

Image converter writes a new file in the chosen format at exactly the same width and height. The new name keeps the old one with the new extension, so logo.png becomes logo.jpg. When the format stays the same, the name gets -converted added, so logo.png saved as PNG becomes logo-converted.png. The Quality slider sits under More options and starts at 90. The copy is made from the pixels alone. Camera details, the date and any location stored in the original aren’t carried into it, and the conversion runs in your browser without uploading the picture.

Tools in this guide