PNG vs WebP

WebP is smaller in almost every case; PNG is the safer file to hand to someone.

Choose PNG when

When the file leaves the web — into a print workflow, an old design tool, an email attachment somebody will open in whatever they have. PNG is understood by everything written in the last twenty-five years.

Choose WebP when

For anything served to a browser. WebP does lossless like PNG and lossy like JPG, and its lossless mode is usually a quarter smaller than the same PNG for no visible difference at all.

The thing that catches people out

WebP has two modes and they behave nothing alike. Lossless WebP replaces PNG; lossy WebP replaces JPG and will soften a screenshot exactly as JPG does.

Switching from PNG to WebP

What is lost

PNG carries up to 16 bits per channel and WebP stores 8. The extra precision is what survives heavy correction without banding, so the conversion is best made after the editing rather than before it.

What survives

Nothing is discarded. PNG and WebP both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Transparency survives. Both PNG and WebP store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

What the target format adds

WebP can hold animation; a PNG is one frame. The result is a single-frame file in a format that could hold more.

Opening the result

Adobe Photoshop and GIMP read both PNG and WebP, so there is a way to check the result against the original without a second tool.

What each format is for

PNG is PNG Development Group's format, published in 1996. It records 16 bits per channel.

WebP comes from Google and dates from 2010, specified as RFC 9649. Adobe Photoshop, GIMP and Squoosh all read it.

Switching from WebP to PNG

What is lost

PNG holds a single still image. An animated WebP keeps its first frame and loses the rest, so a conversion is a way to take a still out of one, not a way to move it.

What survives

Nothing is discarded. WebP and PNG both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Transparency survives. Both WebP and PNG store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Opening the result

Adobe Photoshop and GIMP read both WebP and PNG, so there is a way to check the result against the original without a second tool.

What each format is for

WebP is Google's format, published in 2010. It records 8 bits per channel.

PNG comes from PNG Development Group and dates from 1996, specified as ISO/IEC 15948. Adobe Photoshop, GIMP and Paint.NET all read it.

What PNG to WebP actually does

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as PNG.

PNG139 KB

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as WebP.

WebP14 KB9.7× smaller

A photographic scene — smooth gradients, soft edges, grain. This is the case WebP is designed for or against, and the figures show which. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as PNG.

PNG7 KB

A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as WebP.

WebP4 KB38% smaller

A transparent background and a gradient across the shape. WebP either keeps both, keeps one, or fills the transparency with a solid colour — which is the difference that catches people out. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as PNG.

PNG3 KB

A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as WebP.

WebP11 KB4.2× larger

Flat colour and hard edges, as in an interface, a chart or a logo. Very different behaviour from the photograph above, and the reason the answer is "it depends what is in the file". Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.

Side by side

PNG and WebP compared row by row: what each stores, and what it costs.
PNGWebP
Full namePortable Network GraphicsWebP Image
Extension.png.webp
Media typeimage/pngimage/webp
CompressionLossless — nothing is discardedEither, depending on the setting
This site can write itYesYes

WebP does everything PNG does, and less expensively

This is not a comparison of two formats with different strengths. WebP has a real alpha channel, a lossless mode that reproduces every pixel exactly, and a lossy mode PNG never had — so there is no capability PNG holds that WebP lacks.

What changes is the size. Lossless WebP is typically a quarter to a half smaller than the same PNG with nothing given up at all, and lossy WebP goes far below that for images where a small imperceptible loss is acceptable. On a site carrying twenty interface assets, that is the whole difference between a fast first impression and a slow one.

Lossless WebP genuinely means lossless

The phrase gets used loosely enough to be worth stating plainly. WebP’s lossless mode reproduces every pixel exactly — not "visually lossless", not "near-lossless". A comparison tool finds no differences at all, because there are none.

What changes is only how compactly those pixels are described, using techniques PNG’s 1996 compression did not have. That is why the choice for a logo or an icon set is not between quality and size: lossless WebP is the same image in fewer bytes, and the only thing being weighed is compatibility.

So why keep PNG at all

Because of everywhere that is not a browser. Every current browser has read WebP for years, including Safari, so on a web page it is settled. Outside one, support is patchy in exactly the places that matter socially: email clients, older phone galleries, chat applications, some content-management upload forms, plenty of desktop software, and printing workflows.

The practical rule that follows is about the destination rather than the image. Serving on a web page: WebP. Attaching to an email, handing to a client, uploading to somebody else’s system, sending to a printer: PNG, every time. Nobody has ever been thanked for emailing a WebP.

Favicons and a few other exceptions

A favicon should not be WebP — browser support for it in that role is patchy and inconsistent, the file is tiny anyway, and the risk is not worth the two kilobytes. PNG or ICO, as it has always been.

The other exception is any image a visitor is meant to download and use: a press photograph, a logo pack, a template, a diagram somebody will paste into a document. Deliver those as PNG regardless of what the page itself displays, because the recipient’s software is unknown and their tolerance for an unfamiliar extension is low.

The flat-graphic caveat

The saving is not uniform, and claiming it is would be dishonest. On screenshots, photographs stored as PNG and detailed interface assets, lossless WebP wins clearly. On very small flat graphics — a two-colour bullet, a spacer, a simple icon of a few hundred bytes — PNG is already close to the floor and WebP can come out slightly larger.

This matters when a build pipeline converts an entire asset folder and the total barely moves. Convert five representative files of your own and compare the byte counts before rewriting a build. It takes ten minutes and it beats any general rule, including this one.

Keep the PNGs when you convert

The standard way to serve WebP is a picture element with a WebP source and a PNG fallback, which only works if the PNG still exists. Converting an asset folder in place is the mistake to avoid.

Keep the originals in version control as the master, generate WebP as a build step, and the site gets the smaller files while the next format — whatever it turns out to be — can still be generated from a lossless source. An asset library that has been converted in place can only ever produce copies of a copy.

Where AVIF fits

For photographs, AVIF is usually smaller again than WebP, sometimes substantially. For flat interface graphics it is frequently larger, and its encoding is much slower.

So the sensible arrangement is not to pick one successor. Serve AVIF first, WebP second, PNG as the fallback, and let each browser take the best it understands. If that is more pipeline than the site justifies, WebP alone with PNG behind it captures most of the benefit for a fraction of the complexity.

PNG or WebP: common questions

Is WebP better than PNG?

For serving on a web page, yes without much qualification — it does everything PNG does, transparency included, in a quarter to a half fewer bytes losslessly. Outside a browser PNG is still the safer file, and that is the whole of the argument for keeping it.

Is lossless WebP really lossless?

Yes, exactly. Every pixel is reproduced identically — not "visually lossless" but bit-for-bit the same image. Only the way those pixels are described changes, using compression PNG did not have.

Does WebP keep transparency?

Fully, with a real alpha channel including partial transparency. A cut-out logo or an image with soft edges converts with no fill colour to choose, which is the main reason WebP can replace PNG rather than only JPG.

Should I replace all my PNGs with WebP?

On the site, serve WebP with PNG as a fallback — which means keeping the PNGs rather than converting in place. Anywhere a person receives the file directly, by email, download or upload form, send PNG.

Why did my WebP come out larger than the PNG?

Very small flat graphics — a two-colour bullet, a spacer, a simple icon — are already close to the smallest they can be, and there is nothing left for a better codec to take away. The saving is real on screenshots and detailed assets, and can be zero or negative on tiny ones.

Can I use a WebP as a favicon?

Not reliably. Browser support in that specific role is patchy, and the file is tiny anyway, so there is nothing to gain. Use PNG or ICO for the favicon whatever the rest of the site serves.

Decided? Convert it here

Where these figures come from

The claims this page makes about PNG and WebP are checkable, and these are the documents that settle them.