WebP vs JPEG: Which Image Format Should You Use?
WebP usually produces smaller files than JPEG at the same visual quality, but JPEG still wins on compatibility. A practical guide to choosing between them.
By JFIF.IO TeamPublished 3 min read
JPEG has been the default format for photographs since the 1990s. WebP, introduced by Google in 2010, was designed to replace it on the web. Today both are everywhere, and the right choice depends on where the image is going.
File size and quality
Google’s published studies found lossy WebP files to be 25–34% smaller than JPEG files of comparable visual quality. In practice the savings vary with the content — smooth gradients and detailed textures behave differently — but WebP is reliably smaller for typical website photos.
Two technical reasons explain most of the gap:
- Better prediction. WebP predicts each block of pixels from its neighbours before encoding the difference, so there is less information left to store.
- Arithmetic coding. WebP’s entropy coder squeezes the remaining data more efficiently than JPEG’s Huffman coding.
JPEG fights back with better encoders. MozJPEG, for example, produces JPEGs 5–15% smaller than a basic encoder at the same quality, narrowing — but not closing — the gap. You can try it yourself with Compress JPG.
Features
| JPEG | WebP | |
|---|---|---|
| Lossy compression | Yes | Yes |
| Lossless mode | No (in practice) | Yes |
| Transparency | No | Yes, also in lossy mode |
| Animation | No | Yes |
| Maximum size | 65,535 × 65,535 | 16,383 × 16,383 |
| Chroma subsampling | 4:4:4, 4:2:2 or 4:2:0 | Always 4:2:0 in lossy mode |
Transparency is a big deal. Before WebP, a product photo with a transparent background had to be a PNG, which is often several times larger than a JPEG. Lossy WebP with an alpha channel gives you both small files and transparency.
The 4:2:0 limitation matters for fine, saturated detail — thin red text on a blue background, for instance — where WebP can look slightly softer than a high-quality JPEG. For ordinary photographs it is rarely visible.
Compatibility
This is where JPEG still leads:
- Browsers: all current browsers support WebP. Safari was the last to add it, in version 14 (2020).
- Operating systems: current versions of Windows and macOS open WebP natively.
- Everything else: older image editors, print services, some CMS plug-ins, messaging apps and many upload forms still expect JPEG or PNG.
If you download a WebP image and a program refuses to open it, convert WebP to JPG and the problem disappears.
Which should you use?
- Images on your own website: use WebP (or AVIF, see AVIF vs WebP). Serve JPEG as a fallback only if you must support very old browsers.
- Photos you send to other people or upload elsewhere: use JPEG. It opens everywhere.
- Printing and archiving: JPEG at high quality, or a lossless format such as PNG or TIFF.
- Graphics with transparency on the web: WebP instead of PNG.
Serving both
The HTML <picture> element lets the browser pick the best format it supports:
<picture>
<source srcset="/images/hero.webp" type="image/webp">
<img src="/images/hero.jpg" alt="Mountain lake at sunrise" width="1600" height="900">
</picture>
Browsers that understand WebP download the smaller file; the rest fall back to JPEG.
Converting between them
- JPG to WebP — shrink photos for your website.
- WebP to JPG — make downloaded WebP images compatible.
- PNG to WebP — keep transparency with much smaller files.
All conversions run in your browser, so your images are never uploaded.