Compression5 min read·Updated

How to Bulk Compress Images (Keep JPG, PNG or WebP)

To compress a whole folder without changing formats, drop up to 100 images into a browser compressor set to “Same as original” at quality 75–85, or run one command per format: jpegoptim for JPEGs and pngquant for PNGs. Camera photos often shrink by half or more, especially when you also cap the width, and PNG screenshots and graphics often lose 60% or more with a 256-color palette.

What is the fastest way to compress many images at once?

If you do not use a terminal, a browser batch tool is the fastest: no install, and with a local tool nothing is uploaded. If you are comfortable with the command line, one command per format processes thousands of files. Here is how the options compare.

MethodUploads filesKeeps formatTarget sizeSkill needed
Fast WebP Converter compressorNo, runs in the browserYes, or force JPG, PNG or WebPYes, in KBNone
ImageMagick mogrifyNoYesJPEG only (jpeg:extent)Command line
jpegoptimNoYes (JPEG only)Yes (--size)Command line
pngquantNoYes (PNG only)No, quality rangeCommand line
cwebpNoNo, outputs WebPYes (-size, in bytes)Command line
Mac sipsNoYesNoTerminal basics
PowerToys Image ResizerNoYesNo, JPEG quality onlyNone once installed
Online upload compressorsYesUsuallyVariesNone

How do I bulk compress images in the browser without uploading them?

  1. Open the image compressor and drop the images from your folder, up to 100 per batch. They are processed on your device.
  2. Leave the output on Same as original: JPG stays JPG, PNG stays PNG, WebP stays WebP.
  3. Choose Quality 75–85 for photos, or Target size when every file must fit a limit, such as 200 KB for a form or a CMS.
  4. Optionally turn on Limit width (2000 px suits most uses). Images narrower than the limit are never upscaled.
  5. Download the results. The whole batch is processed free and the first file downloads free; downloading every file and the ZIP is part of Pro.

PNGs are reduced to a palette of up to 256 colors with transparency kept, the same idea as pngquant. Metadata such as GPS location is removed, and if a file cannot get smaller in its own format, the tool keeps the original rather than returning a bigger file.

How do I bulk compress images from the command line?

Work on a copy of the folder: several of these tools overwrite files in place by default. Also note that *.jpg does not match *.JPG on Mac and Linux, and many cameras use capital extensions.

ImageMagick mogrify (JPEG, PNG, WebP)

mkdir compressed && magick mogrify -path compressed -quality 80 -resize '2000x2000>' *.jpg re-saves every JPEG at quality 80 into the compressed folder, shrinking only images larger than 2000 px (that is what the > means). On ImageMagick 6, type mogrify without magick. Without -path, mogrify overwrites the originals. For a JPEG size cap, add -define jpeg:extent=200KB.

jpegoptim (JPEG only)

mkdir compressed && jpegoptim --max=80 --strip-all --dest=compressed *.jpg lowers any JPEG above quality 80 to 80 and removes metadata. Replace --max=80 with --size=200 to aim for about 200 KB per file. Files it cannot improve are not copied to the destination folder.

pngquant (PNG only)

pngquant --quality=65-80 --skip-if-larger --ext .png --force *.png converts each PNG to a palette of up to 256 colors and overwrites it, skipping files that would not get smaller. Drop --ext .png --force to write copies ending in -fs8.png next to the originals instead.

cwebp (when WebP output is fine)

for f in *.png; do cwebp -q 80 "$f" -o "${f%.png}.webp"; done converts a folder to WebP. This changes the format, so it belongs to a different workflow: see bulk convert images to WebP.

How do I compress a folder of images on a Mac?

macOS includes sips. In Terminal, inside the folder, mkdir compressed && sips -s formatOptions 80 *.jpg --out compressed re-saves every JPEG at quality 80 in a new folder. Adding -Z 2000 caps the longest side at 2000 px, but sips also enlarges smaller images to that size, so use it only when every photo is bigger. Without Terminal, select the images in Finder, Control-click and choose Quick Actions > Convert Image, then pick a format and an image size. More options are in reduce image size on Mac.

How do I bulk compress images on Windows?

Install Microsoft PowerToys, select the images in File Explorer, right-click and choose Resize with Image Resizer. Pick a preset (Small 854 × 480, Medium 1366 × 768, Large 1920 × 1080, Phone 320 × 568) or a custom size, and tick the option that only makes pictures smaller. Image Resizer saves each file in its original format; the JPEG quality is set in the PowerToys Image Resizer settings (90 by default; 80 is plenty for photos). It has no target size. See reduce image size on Windows for built-in alternatives.

Compress once, from the originals
Running a batch twice, or compressing files that a phone or a CMS already compressed, removes detail each time for a smaller and smaller gain. Keep the original folder and always start from it.
Drop the folder, keep each format, and set one quality or target size for all of them.

Put it into practice

Compress your images right now: keep the format or set a target size, free and privately in your browser.

Open the compressor

Frequently asked questions

Fast WebP Converter takes up to 100 images per batch, processed on your device without uploading. For thousands of files, a command-line tool such as jpegoptim or pngquant is more practical.

jpegoptim --max=80 *.jpg re-saves JPEGs above quality 80 at 80 and leaves dimensions alone. It overwrites the files unless you add --dest=folder.

It depends on the tool. Fast WebP Converter removes metadata, jpegoptim does with --strip-all, and ImageMagick keeps it unless you add -strip.

No. pngquant and the browser compressor both keep the alpha channel when they reduce a PNG to a palette.

Keep reading

Tutorial5 min read

Bulk convert to WebP

The fastest way to batch convert hundreds of PNG and JPG images to WebP: drag, drop, set quality once, download a ZIP. Private, browser-based, no command line.

Read more
Performance6 min read

Compress PNG

PNGs are huge because they are lossless. Convert UI to high-quality WebP and photos to WebP 80%.

Read more
Performance6 min read

Compress JPG

A second JPEG pass looks worse. Convert JPEG to WebP once at 80% from the best master you have.

Read more