## Why Convert JPG to WebP?
WebP is Google's modern image format for the web. Vs JPG at equivalent visual quality:
- **25-35% smaller file size**
- Supports **transparency** (like PNG)
- Supports **animation** (like GIF)
- Works in all modern browsers (Chrome, Firefox, Safari 14+, Edge)
Smaller images = faster loads, better Core Web Vitals, lower bandwidth costs.
## Conversion Methods
### cwebp (Google's official tool)
```bash
cwebp -q 80 image.jpg -o image.webp
# Batch
for f in *.jpg; do cwebp -q 80 "$f" -o "${f%.jpg}.webp"; done
```
### FFmpeg
```bash
ffmpeg -i image.jpg -c:v libwebp -quality 85 image.webp
```
### ImageMagick
```bash
convert image.jpg -quality 80 image.webp
mogrify -format webp -quality 80 *.jpg
```
### Squoosh (visual comparison)
squoosh.app — Google's browser tool for side-by-side quality vs size comparison.
## Quality Settings
| Image Type | WebP Quality | Result |
|-----------|-------------|--------|
| General photography | 75-85 | Best balance |
| Product images | 85-90 | Detail preserved |
| Thumbnails | 65-75 | Maximum savings |
| Art / illustrations | 90-95 | No artifacts |
## HTML with Fallback
```html
```
Browsers that support WebP get the smaller file; others fall back to JPG automatically.
## Core Web Vitals Impact
- **LCP**: Hero images load faster
- **PageSpeed Insights**: Google flags "legacy format" images as an optimization
- **Mobile**: Significant data savings for users on cellular connections