WebP vs PNG vs JPG: Choosing the Right Image Format

JPG is for photos that must open anywhere, PNG is for exact pixels, and WebP does both jobs in smaller files on the web.

Picking an image format comes down to three questions: may the encoder throw away detail, does the image need transparent areas, and where will the file be opened? JPG, PNG and WebP each answer those differently. WebP is usually the best choice for images on a website, but PNG and JPG still win in some places, and knowing which saves you from blurry logos, white boxes around cut-outs and upload forms that reject your file.

The formats side by side

JPG (JPEG)PNGWebP
CompressionLossyLosslessLossy or lossless
TransparencyNoYes, full alpha channelYes, in both modes
AnimationNoThrough APNGYes
Colour depth8 bits per channel in practiceUp to 16 bits per channel8 bits per channel
Maximum size65,535 × 65,535 pixelsOver 2 billion pixels per side16,383 × 16,383 pixels
Opens inPractically everythingPractically everythingAll current major browsers; not every app or upload form
Best forPhotos that must work everywhereScreenshots, UI, graphics with sharp edgesMost images on a website

Lossy and lossless: the real difference

Lossy compression discards detail the eye is unlikely to notice, and a quality setting decides how much. It suits photographs, where noise and gradients hide small changes. It hurts text, thin lines and flat areas of colour, which pick up soft edges and faint blotches. Every re-save loses a little more, so always convert from the original rather than from an earlier JPG.

Lossless compression keeps every pixel exactly. It is the right choice for screenshots, diagrams, pixel art and anything you will edit again. For a photograph it produces a much larger file, because camera noise is expensive to store exactly.

JPG is only lossy and PNG is only lossless. WebP has both modes in one format, which is its main practical advantage: a photo and a screenshot can both be WebP, each compressed the appropriate way.

How much smaller is WebP?

Google, which developed the format, publishes this comparison: lossless WebP images are 26% smaller than PNGs, and lossy WebP images are 25–34% smaller than comparable JPEGs at equivalent SSIM quality. Those are averages over Google's test images, not a promise for every file.

Your own results can be better or worse. Google's WebP FAQ notes that a WebP can come out larger than its source, typically when a PNG with only a few colours is converted to lossy WebP, or when an already lossy image is stored as lossless WebP. Lossy WebP also always uses 4:2:0 chroma subsampling, storing colour at half the horizontal and vertical resolution of brightness, so saturated red or blue edges in graphics can look slightly smeared where a PNG stays crisp. The reliable approach is to convert and compare: the Image Converter shows the original and new size of every file, so you can see the actual saving before you keep it.

Transparency and animation

JPG has no alpha channel. Converting a transparent logo to JPG fills the transparent area with a solid colour; this site's converter uses white. PNG stores full alpha losslessly, which makes transparent photos, such as product cut-outs, heavy. WebP supports alpha in lossy mode too, so a cut-out photo can keep its soft edges at a fraction of the PNG size. That case is where PNG to WebP saves the most.

For animation, JPG has none, PNG has the APNG extension, and WebP has animation built in. According to Google, animated WebP files can be smaller than the same animation as GIF or APNG. For long or complex clips, a muted MP4 or WebM video is usually lighter than any image format.

Which format to use

ImageUseWhy
Photos on a websiteWebP, lossySmallest widely supported option
Photos for email, print or upload formsJPGOpens in every program and passes every form
Screenshots with text, UI mock-upsPNG or lossless WebPText stays sharp, nothing is smeared
Logos and iconsSVG if you have vectors, otherwise PNG or WebPKeeps sharp edges and transparency
Product photo with a transparent backgroundWebP, lossy with alphaSoft edges at a fraction of the PNG size
Short animationAnimated WebP, or MP4/WebM for longer clipsMuch lighter than GIF
Master copies you will edit againPNG, or the original camera fileNo generation loss

Moving existing images over is quick: JPG to WebP for photos, PNG to WebP for graphics and cut-outs. When a WebP will not open in older software, WebP to JPG fixes it, and PNG to JPG shrinks photos that were saved as PNG by mistake.

Browser support and a fallback with picture

Current versions of Chrome, Edge, Firefox and Safari all display WebP, so for most sites a WebP in an ordinary <img> is enough. If you must also support old browsers, or you want to offer a newer format first, use the <picture> element. The browser takes the first <source> whose type it supports and falls back to the <img>, which also carries the alt text and dimensions:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Harbour at sunset" width="1600" height="900">
</picture>

A server or CDN can do the same job without extra markup by looking at the Accept header of the image request and returning WebP when it is listed. If you do that, send Vary: Accept so caches keep the versions apart.

Where AVIF fits

AVIF is based on the AV1 video codec and is supported by current versions of Chrome, Edge, Firefox and Safari. It often produces smaller files than WebP at similar visual quality, but it is slower to encode and fewer tools, editors and upload forms accept it. A common setup is AVIF first, WebP second and JPG last, as in the example above. This site's converter can read AVIF files when your browser can decode them, but it writes WebP, PNG, JPG and ICO, not AVIF.

Converting in the browser: a Safari caveat

Browser-based converters draw the image on a canvas and ask the browser to encode it. Chrome, Edge and Firefox can encode WebP that way. Safari displays WebP but cannot encode it from a canvas and quietly returns a PNG instead, so this site's converter stops with a message rather than saving a PNG with a .webp name. On a Mac, run WebP conversions in Chrome, Edge or Firefox. On an iPhone or iPad, other browsers generally use Safari's engine as well, so convert on a computer or choose PNG or JPG.

Two more things are worth knowing. In Chrome, a quality of 100 produces a lossless WebP, while lower values produce lossy WebP; we confirmed this by inspecting the encoded files. And canvas encoding does not copy metadata, so EXIF data such as the camera model and GPS position is left out of the converted file.

Frequently Asked Questions

Is WebP better than PNG?

For images shown on a website, usually yes: Google reports lossless WebP files 26% smaller than PNG on average, and WebP also offers lossy compression with transparency. Keep PNG for master copies, for software that does not read WebP, and for the rare image where WebP comes out larger.

Is WebP better than JPG?

On the web it normally gives smaller files at the same visual quality; Google measured lossy WebP 25 to 34 percent smaller than comparable JPEGs. JPG remains the safer choice for email attachments, printing and upload forms that list only JPG or PNG.

Does WebP support transparency?

Yes, in both lossless and lossy mode. That makes it a good replacement for large transparent PNGs such as product cut-outs.

Why can I not convert to WebP on my iPhone?

Safari can display WebP but cannot create WebP files from a canvas, which browser-based converters rely on. Use Chrome, Edge or Firefox on a computer for that conversion, or convert to JPG or PNG instead.