Category: Files & FormatsExplainerImage formats explained · Part 1 of 1ConversionImage formatsWebP

What Is a WebP File? Lossy, Lossless and Browser Support

WebP is an image format built for the web. Here is what it stores, how much space it saves over JPEG and PNG, and how to convert it.

By Published 4 min read Formats: .webp.png.jpg

A bright landscape photo print folded into a smaller square on a concrete table
AI-generated imageThe same photo, folded smaller: WebP keeps the picture and cuts the file size.

A WebP file is an image saved in the WebP format, which keeps pictures in a RIFF container and can compress them either lossily, like JPEG, or losslessly, like PNG. It also handles transparency and animation. Google's own measurements put lossless WebP at about a quarter smaller than PNG, and Chrome, Edge, Firefox and Safari all list support for it.

In short

  • WebP is an image format built on the RIFF container, described in RFC 9649.
  • One format covers lossy and lossless compression, transparency and animation.
  • Google measured lossless WebP 26% smaller than PNG and lossy WebP 25–34% smaller than JPEG.
  • The free cwebp and dwebp tools convert images to WebP and back to PNG.
On this page 9 sections

What a WebP file is#

A file ending in .webp holds one image, or a short animation, in the WebP format. The format is written down in RFC 9649, which describes WebP as an image file format based on the Resource Interchange File Format (RIFF)[1].

RFC 9649 was published in November 2024 in the Informational category[1]. That makes it a reference description of a format already in wide use rather than a new standard. The same document records that IANA has registered the image/webp media type[1], which is the label servers send so that browsers know what they are receiving. If you want the short catalogue entry for the extension, see the .webp file type page.

Lossy and lossless WebP#

Most image formats pick one compression approach. WebP has two, and a single file uses one of them. According to RFC 9649, the format supports lossless and lossy compression as well as alpha (transparency) and animation[1]. Google's WebP FAQ says the same in its own words[2].

Lossy WebP throws away detail the eye is unlikely to miss, which is how JPEG works too. Google's FAQ explains that lossy WebP works exclusively with an 8-bit Y'CbCr 4:2:0 image[2]. In practice this means colour is stored at a lower resolution than brightness, which suits photographs and is a poor fit for sharp-edged screenshots with coloured text.

Lossless WebP keeps every pixel exactly as it was. The FAQ states that lossless WebP works exclusively with the RGBA format[2], so red, green, blue and alpha values are kept at full precision. This mode is the one to choose for logos, diagrams, screenshots and anything you plan to edit again.

How much smaller WebP files are#

The main reason websites switch to WebP is file size. Google publishes the figures below on the WebP home page[3]. They come from Google's own tests, and the result for any single image depends on its content, so treat them as typical savings across a large set of images.

ComparisonResult reported by Google
Lossless WebP vs PNG26% smaller files[3]
Lossy WebP vs JPEG at equivalent SSIM quality25–34% smaller files[3]
Transparency in lossless WebP22% additional bytes[3]
Source: Google for Developers, WebP home page, read on 2026-11-12.

SSIM is a measure of how similar two images look, so the JPEG comparison is between files of matching visual quality, not matching quality settings. For pictures that need transparency, Google adds that lossy WebP can carry an alpha channel as well[3].

Which browsers open WebP#

Browser support used to be the reason to avoid WebP. That changed when Firefox and Safari added it. Google's FAQ lists the first versions that display WebP images with lossless compression and transparency, including Google Chrome (desktop) 23+, Microsoft Edge 18+, Firefox 65+ and Safari 14+ on iOS 14 and macOS Big Sur or later[2].

Animated WebP arrived a little later in Chrome. The FAQ gives Google Chrome (desktop and Android) 32+ for animation, alongside the same Edge, Firefox and Safari versions[2].

How to convert images to and from WebP#

Google distributes two small command-line tools with the WebP library. The first, cwebp, is documented as a tool to compress an image file to a WebP file[4]. Its documentation lists the accepted input as PNG, JPEG, TIFF, WebP or raw Y'CbCr samples[4]. A basic conversion looks like this:

cwebp -q 80 photo.jpg -o photo.webp
cwebp -lossless logo.png -o logo.webp

The -q option sets the compression factor between 0 and 100, and the documentation gives 75 as the default[4]. The -lossless switch encodes the image without any loss, which is the setting to use for graphics.

The second tool, dwebp, goes the other way. Its manual describes it as a tool to decompress a WebP file to an image file, writing PNG by default[5]:

dwebp image.webp -o image.png

Converting a lossy WebP back to PNG gives you a file that opens everywhere, but it does not restore detail that lossy compression removed. If you received a lossy WebP, the PNG copy will be larger and no sharper.

Limits worth knowing#

WebP images cannot be arbitrarily large. Google's FAQ puts the maximum pixel dimensions of a WebP image at 16383 x 16383[2]. Larger scans and panoramas have to be split or kept in another format.

The lossy mode's reduced colour resolution, described above, is the other limit to keep in mind. Text, thin lines and pixel art should go through lossless WebP or stay in PNG.

Summary#

WebP is one image format that covers the jobs JPEG and PNG split between them, with transparency and animation on top. Google's measurements show clear size savings over both, current browsers display it, and the free cwebp and dwebp tools handle conversion in either direction. Use lossy WebP for photos, lossless WebP for graphics, and convert to PNG with dwebp when a program you use cannot open the file.

Frequently asked questions

Is WebP lossless or lossy?

It can be either. RFC 9649 describes WebP as supporting both lossless and lossy compression[1], and each file uses one of the two modes.

How do I convert a WebP file to PNG?

Use Google's dwebp tool, which decodes a WebP file and writes PNG by default[5]: dwebp image.webp -o image.png.

What is the largest image a WebP file can hold?

Google's WebP FAQ gives the maximum pixel dimensions as 16383 x 16383[2].

Sources

Numbers in square brackets in the text point to these sources.

  1. 1 RFC 9649: WebP Image FormatIETF / RFC Editor · accessed Nov 26, 2026rfc-editor.org
  2. 2 Frequently Asked Questions | WebPGoogle for Developers · accessed Nov 26, 2026developers.google.com
  3. 3 An image format for the Web | WebPGoogle for Developers · accessed Nov 26, 2026developers.google.com
  4. 4 cwebp | WebPGoogle for Developers · accessed Nov 26, 2026developers.google.com
  5. 5 dwebp | WebPGoogle for Developers · accessed Nov 26, 2026developers.google.com

CategoryCategory: Files & FormatsTagsConversionImage formatsWebP

Related file types