If you've run a Google PageSpeed Insights test and gotten the warning "Serve images in next-gen formats", Google is asking for exactly this: converting your JPG and PNG images to WebP. It's one of the highest-impact changes for a site's performance — and also one of the simplest to implement.

Why convert to WebP?

WebP is a format developed by Google and launched in 2010, designed specifically for the web. It uses more modern compression algorithms than JPG and PNG and offers, at the same visual quality:

In practice, the impact is real. An e-commerce product gallery with 20 photos at 300 KB each in JPG (6 MB total) can drop to 4 MB in WebP at the same visual quality — a 33% reduction in page weight. For Google, that means a faster LCP, a better PageSpeed score, and a potential ranking boost.

FeatureWebPJPGPNG
Lossy compression (photos)✅ Very efficient✅ Efficient❌ Not supported
Lossless compression✅ Supported❌ Not supported✅ Supported
Transparency (alpha channel)✅ Supported❌ Not supported✅ Supported
Animation✅ Supported❌ Not supported❌ Not native
Size vs equivalent JPG25–35% smallerBaseline50–300% larger
Browser compatibility>97% (2026)100%100%

When not to use WebP

Despite being the best format for the modern web, there are situations where WebP still isn't the right choice:

Practical summary: use WebP for everything that goes on the web — website, blog, e-commerce, social media. Use JPG or PNG for email marketing, printing, and files sent to third parties who may not support WebP.

Method 1 — Online conversion (fastest, nothing to install)

To convert one-off images — or when you need a quick result without configuring anything — an online converter is the most direct route. The ImageTools Image Converter converts JPG, PNG and other formats to WebP directly in the browser, with no files uploaded to external servers.

  1. Open the Image Converter.
  2. Select or drag the images onto the upload area.
  3. Choose WebP as the output format.
  4. Download the converted images individually, or as a ZIP if there are multiple files.

Convert to WebP now — online and free

JPG, PNG and more — no sign-up, no files uploaded to external servers, no size limit.

Convert to WebP

Method 2 — WordPress (automatic for the whole site)

For WordPress sites, the most efficient approach is using a plugin that converts and serves WebP automatically — with no need to manually reprocess each image.

WordPress 6.1+ (native conversion)

Starting with version 6.1, WordPress converts images to WebP automatically on upload, as long as the server supports the libwebp library (most modern servers with PHP 8+ do). You don't need to do anything — WordPress generates WebP versions of images and serves the right format to each browser automatically.

To check if it's active: go to Settings → Media and look for the WebP conversion option. If it isn't available, the server doesn't support it — consider a plugin.

With plugins (older versions or more control)

The most-used plugins for WebP conversion in WordPress are:

Method 3 — Command line with cwebp (for developers)

Google freely distributes the cwebp tool — the official WebP encoder — for conversion via terminal. It's the fastest method for converting large batches of images on a server or build pipeline.

Installation

# Ubuntu / Debian
sudo apt-get install webp

# macOS (Homebrew)
brew install webp

# Windows — download the binary at: https://developers.google.com/speed/webp/download

Basic conversion

# Convert a JPG file to WebP at quality 80
cwebp -q 80 photo.jpg -o photo.webp

# Convert PNG to lossless WebP
cwebp -lossless logo.png -o logo.webp

# Convert every JPG in a folder (Bash)
for f in *.jpg; do cwebp -q 80 "$f" -o "${f%.jpg}.webp"; done

The -q parameter controls quality (0–100). For the web, values between 75 and 85 offer the best balance between visual quality and file size. Use -lossless for images that need lossless compression (logos, screenshots with text).

Method 4 — Node.js with sharp (for build pipelines)

For projects using Node.js — like sites built with Next.js, Gatsby, Nuxt, or any automated build — the sharp library is the most efficient option for WebP conversion in a pipeline:

// npm install sharp

const sharp = require('sharp');

// Convert JPG to WebP at quality 80
sharp('photo.jpg')
  .webp({ quality: 80 })
  .toFile('photo.webp');

// Convert PNG to lossless WebP
sharp('logo.png')
  .webp({ lossless: true })
  .toFile('logo.webp');

// Convert every file in a folder
const fs = require('fs');
const path = require('path');

fs.readdirSync('./images')
  .filter(f => /\.(jpg|jpeg|png)$/i.test(f))
  .forEach(file => {
    const input = path.join('./images', file);
    const output = path.join('./images', file.replace(/\.[^.]+$/, '.webp'));
    sharp(input).webp({ quality: 80 }).toFile(output);
  });

sharp uses the native libvips library and is significantly faster than pure JavaScript solutions — ideal for generating WebP versions during a static site build.

How to implement WebP with fallback for older browsers

Although WebP compatibility in 2026 is above 97%, there can still be contexts where a fallback is needed — corporate systems with IE11, very old devices, or simply for maximum compatibility assurance.

The correct solution is the HTML <picture> tag, which lets you declare alternative image sources in order of preference:

<!-- The browser uses WebP if supported, otherwise falls back to JPG -->
<picture>
  <source srcset="photo.webp" type="image/webp">
  <img src="photo.jpg" alt="Photo description" width="800" height="600">
</picture>

<!-- With multiple sizes for Retina screens -->
<picture>
  <source
    srcset="photo-800.webp 800w, photo-1600.webp 1600w"
    type="image/webp">
  <source
    srcset="photo-800.jpg 800w, photo-1600.jpg 1600w"
    type="image/jpeg">
  <img src="photo-800.jpg" alt="Photo description"
    width="800" height="600" loading="lazy">
</picture>

The browser evaluates the sources in the declared order: if it supports WebP, it uses the <source> with type="image/webp". If not, it falls back to the JPG in <img>. The <img> tag at the end is mandatory — it defines the alt, dimensions, and default behavior.

Configuring the server to serve WebP automatically (Apache)

An alternative to <picture> is configuring the server to detect whether the browser accepts WebP and serve the correct version automatically. In Apache, add this to .htaccess:

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Serve .webp if it exists and the browser accepts it
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{REQUEST_FILENAME} \.(jpe?g|png)$
  RewriteCond %{REQUEST_FILENAME}\.webp -f
  RewriteRule ^ %{REQUEST_URI}.webp [T=image/webp,L]
</IfModule>

<IfModule mod_headers.c>
  Header append Vary Accept env=REDIRECT_accept
</IfModule>

AddType image/webp .webp

With this configuration, you just need the .webp files side by side with the originals in the same folder. Apache detects whether the browser accepts WebP via the Accept header and serves the correct version with no changes to the HTML.

Checking the result in PageSpeed

After implementing WebP, run Google PageSpeed Insights (pagespeed.web.dev) on your site's URL. The "Serve images in next-gen formats" warning should disappear or shrink significantly. In the opportunities panel, you'll see the estimated KB savings for each image not yet converted.

Another way to check: open Chrome DevTools (F12), go to the Network tab, filter by "Img", and look at the "Type" column for loaded images. If it shows webp, the conversion is working.

Impact on LCP: Largest Contentful Paint — one of the Core Web Vitals metrics — is often determined by the page's main image (banner, product photo). Converting that image to WebP reduces its download time, directly impacting LCP and Google's performance score.

What quality level should you use in the conversion?

WebP quality follows the same logic as JPG: higher values preserve more detail but produce larger files. The difference is that, for the same visual quality, WebP typically uses a quality value 10–15 points lower than the equivalent JPG.

Use caseRecommended WebP qualityApproximate JPG equivalent
Product photos (e-commerce)80–8590–95
Blog and article images75–8085–90
Website banner and hero80–8590–95
Thumbnails70–7580–85
Logos and graphics (lossy)9095+
Logos and graphics (lossless)-losslessPNG

Frequently asked questions

Does Google index WebP images for Google Images?
Yes. Googlebot supports WebP and indexes images in this format normally. Google Images displays WebP images with no difference compared to JPG or PNG. Converting to WebP has no negative impact on image SEO — quite the opposite, it improves page speed, which has an indirect positive impact on ranking.
Do I need to keep the original JPG/PNG files after converting to WebP?
Yes, especially for two reasons: fallback in contexts that don't support WebP (email, printing, legacy platforms), and a maximum-quality file for future edits. Best practice is to keep the JPG or PNG originals in an originals folder and the converted WebPs in the folder used on the site. Never discard the higher-quality original.
Is WebP better than AVIF?
AVIF is technically more efficient than WebP — it produces even smaller files at equivalent quality. But AVIF's compatibility in 2026 is still lower than WebP's, and AVIF encoding is significantly slower (relevant for batch conversions on a server). In practice, WebP is still the most balanced choice for the web: excellent compression, broad compatibility, and fast encoding. AVIF is worth evaluating for high-traffic sites where every KB saved has a meaningful impact on bandwidth costs.
Does my CMS convert to WebP automatically?
It depends on the CMS and version. WordPress converts to WebP natively since version 6.1 if the server supports libwebp. Shopify has served WebP automatically since 2021 for all themes. Squarespace and Wix also apply WebP automatically. For custom CMSes or older versions, a plugin or manual server configuration is needed.
How do I convert to WebP in bulk (hundreds of images)?
For large volumes, the command line with cwebp or a Node.js script with sharp is the most efficient method — you process hundreds of images in seconds with a single command. For WordPress, plugins like ShortPixel and Imagify have an option to reprocess the entire media library at once. For occasional manual use, the ImageTools Image Converter supports multiple files in a single session.
Why did my WebP end up bigger than the original JPG?
This can happen in two situations: if the original JPG was already very well compressed (below 70% quality), there isn't much room for WebP to improve on it. Or if you're comparing a high-quality WebP (90+) with a low-quality JPG. For a fair comparison, use equivalent quality settings on both formats — and remember that for the same visual quality, WebP usually uses a numeric quality setting 10–15 points lower than JPG, as shown in the table above.