# How to Batch Convert Images with Command Line Tools
Converting 500 photos from JPG to WebP one by one would take hours. Batch conversion lets you process entire folders in seconds.
## Option 1: Online tool (no installation needed)
For small batches (<50 files, <500 MB total) the fastest approach is uploading files directly:
1. Go to [KaijuConverter](/convert/jpg-to-webp) and select the format pair you need
2. Drag all files at once (or use "Select files")
3. Download the ZIP with the results
> Online tools have size limits. For large batches, use the command-line options below.
## Option 2: ImageMagick (all static image formats)
**ImageMagick** is the Swiss Army knife of image manipulation. It converts, resizes, crops, and applies effects in batch.
### Install ImageMagick
- **Windows**: download the installer from [imagemagick.org](https://imagemagick.org/script/download.php)
- **macOS**: `brew install imagemagick`
- **Linux**: `sudo apt install imagemagick`
### Batch convert JPG → WebP
```bash
# Convert all JPGs in the current folder to WebP
for f in *.jpg; do convert "$f" "${f%.jpg}.webp"; done
# Windows PowerShell
Get-ChildItem *.jpg | ForEach-Object { magick $_.Name ($_.BaseName + ".webp") }
# With custom quality (0-100)
for f in *.jpg; do convert -quality 85 "$f" "${f%.jpg}.webp"; done
```
### Resize and convert simultaneously
```bash
# Resize to 1200px wide (maintaining aspect ratio) and convert to WebP
for f in *.jpg; do convert -resize 1200x "$f" "${f%.jpg}.webp"; done
# Convert and save to an /output/ subdirectory
mkdir output
for f in *.png; do convert "$f" "output/${f%.png}.jpg"; done
```
## Option 3: cwebp (Google's official WebP encoder)
**cwebp** is faster than ImageMagick for WebP specifically.
```bash
# Install
brew install webp # macOS
sudo apt install webp # Ubuntu/Debian
# Convert all PNGs to WebP at quality 80
for f in *.png; do cwebp -q 80 "$f" -o "${f%.png}.webp"; done
# Parallel processing (faster on multi-core systems)
ls *.jpg | parallel cwebp -q 85 {} -o {.}.webp
```
## Option 4: FFmpeg (images + video frames)
**FFmpeg** handles both video and individual images.
```bash
# Single PNG → JPG
ffmpeg -i image.png image.jpg
# All PNGs in the current folder
for f in *.png; do ffmpeg -i "$f" "${f%.png}.jpg"; done
# With specific quality (2=best, 31=worst for JPEG)
ffmpeg -i photo.jpg -q:v 2 photo_high.jpg
```
## Option 5: Python + Pillow
For complex workflows (renaming, filtering, metadata handling) Python + Pillow is very powerful:
```python
from PIL import Image
import os
input_folder = "original_photos"
output_folder = "webp_output"
os.makedirs(output_folder, exist_ok=True)
for filename in os.listdir(input_folder):
if filename.lower().endswith(('.jpg', '.jpeg', '.png')):
img = Image.open(os.path.join(input_folder, filename))
new_name = os.path.splitext(filename)[0] + ".webp"
img.save(os.path.join(output_folder, new_name), "WEBP", quality=85)
print(f"Converted: {filename} → {new_name}")
print("Done!")
```
## Tool comparison
| Tool | Formats | Speed | Learning curve |
|------|---------|-------|----------------|
| Online tool | Many | Fast (upload) | None |
| ImageMagick | All | Medium | Low |
| cwebp | WebP only | Very fast | Low |
| FFmpeg | Images + video | Fast | Medium |
| Python + Pillow | Many | Medium | Medium |
## Tips for reliable batch conversion
- **Test with 5–10 files** before processing the entire folder
- **Keep originals** — conversion to lossy formats is irreversible
- **Use separate output folders** to avoid overwriting source files
- **Check output sizes** — sometimes WebP can be larger than the source JPG if it was already heavily compressed
With these tools you can fully automate image workflows for your website, blog, or photography projects.
Guide