How to Batch Convert Images to WebP for a Faster Site

Large, uncompressed JPG and PNG files are one of the most common reasons a small business website loads slowly. Switching your images to the WebP format usually cuts file sizes dramatically with little to no visible quality loss, which means faster page loads, better Core Web Vitals scores, and a better experience for visitors on mobile data.

The problem is that converting images one at a time in an editor is tedious once you have more than a handful of photos. This guide walks through the fastest free ways to batch convert a whole folder of images to WebP at once, whether you’re comfortable with a command line or you’d rather use a point-and-click tool.

Quick Answer

The fastest free way to batch convert images to WebP is Google’s own cwebp command-line tool (part of the libwebp package) run in a loop over a folder, or ImageMagick’s mogrify command. If your site runs on WordPress, a plugin like ShortPixel, Imagify, or EWWW Image Optimizer will convert and serve WebP automatically without any manual work.

Batch Converting Images Step by Step

First, decide where the conversion should happen. If you manage images yourself before uploading them, a local tool works best. If your site is on WordPress, letting a plugin handle it automatically is usually less work long-term, since it also optimizes new images you upload in the future.

For local batch conversion, install libwebp (on Mac: ‘brew install webp’; on Ubuntu/Debian: ‘sudo apt install webp’; Windows users can download the libwebp binaries from Google’s WebP project page). This gives you the cwebp command, which converts a single file like ‘cwebp -q 80 photo.jpg -o photo.webp’. To convert an entire folder at once, run a loop from the folder in Terminal or PowerShell, such as looping over every .jpg and .png file and outputting a matching .webp file. A quality setting of around 75 to 85 is a good default for photos — it keeps files small while staying visually close to the original.

If you’d rather avoid the command line, ImageMagick’s ‘mogrify’ command can do the same job in one line, for example ‘magick mogrify -format webp -quality 80 *.jpg’ run inside the image folder. For a no-install option, Squoosh, a free browser-based compressor originally built by the Google Chrome team, lets you drag in images and export WebP locally in your browser, though it’s better suited to converting a few images at a time than hundreds.

For WordPress sites, install an image optimization plugin such as ShortPixel, Imagify, or EWWW Image Optimizer. Each can bulk-convert your entire existing media library to WebP with a few clicks, and will automatically create WebP versions of any new images you upload going forward.

Choosing the Right Method for Your Site

The command-line route (cwebp or ImageMagick) is the best choice if you’re comfortable with a terminal, need full control over quality settings, or are processing images for a static site or a custom-coded project before they ever touch a server.

A WordPress plugin is the better choice for most small business owners, since it handles both the one-time bulk conversion of existing images and ongoing conversion of anything you upload later, and typically also serves the WebP file with a fallback to the original format for the rare visitor on an outdated browser.

Whichever method you use, don’t delete your original JPG or PNG files right away. Keep them as a backup in case you ever need to re-export at a different quality level or switch tools later.

Tips and Common Mistakes

Don’t convert images that are already heavily compressed JPGs expecting dramatic savings — you’ll get the best results converting from high-quality originals, not from images that have already been through multiple rounds of compression. For logos, icons, or graphics with transparency and flat colors, consider lossless WebP conversion instead of the standard lossy setting, since lossy compression can blur sharp edges and fine text.

If you have animated GIFs, standard cwebp won’t convert them correctly — use the companion ‘gif2webp’ tool included with libwebp instead, which preserves the animation.

After converting, spot-check a few images at their actual display size rather than zoomed in, since minor compression artifacts are often invisible at normal viewing size but obvious when zoomed in at 100% quality-checking. Finally, make sure any hardcoded image references in your theme, CSS, or HTML are updated to point to the new .webp filenames if you’re not using a plugin that handles this automatically.

Explore more: more small business tech guides.

Batch WebP conversion FAQs

Does converting to WebP reduce image quality?

At a reasonable quality setting (around 75-85), most photos look visually identical to the original while being noticeably smaller in file size. Very low quality settings or repeated conversions can introduce visible artifacts, so it’s best to convert once from a high-quality original.

Do I need to keep my original JPG or PNG files after converting?

Yes, it’s a good idea to keep the originals as backups. That way you can re-export at a different quality level, switch tools, or revert if a plugin or browser issue ever comes up.

Will WebP images display correctly for all website visitors?

Nearly every current browser, including Chrome, Firefox, Safari, and Edge, supports WebP natively. For extra safety on older browsers or in email/PDF contexts where WebP isn’t supported, a element with a JPG or PNG fallback is a simple safeguard.

Build It With GTStudios

Need help with your website, app, or small-business tech? GTStudios builds web, apps, and software for small businesses. See how GTStudios can help.

Want dev news in your inbox? Subscribe to the free newsletter.