Simple, free API for converting WebP images to JPG or PNG
curl -X POST \
-F "file=@image.webp" \
https://webp2jpg.co/api/convert?format=jpg \
-o output.jpgconst formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://webp2jpg.co/api/convert?format=jpg', {
method: 'POST',
body: formData
});
const blob = await response.blob();
const url = URL.createObjectURL(blob);
// Use the converted imageimport requests
with open('image.webp', 'rb') as f:
files = {'file': f}
response = requests.post(
'https://webp2jpg.co/api/convert?format=jpg',
files=files
)
with open('output.jpg', 'wb') as f:
f.write(response.content)/api/convertConvert a WebP image to JPG or PNG format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | multipart/form-data | Yes | WebP image file (max 10MB) |
| format | query string | No | Output format: jpg or png (default: jpg) |
| quality | query string | No | Quality 1-100 (default: 90) |
Success (200):
image/jpeg or image/png| Header | Description |
|---|---|
| X-Rate-Limit-Remaining | Remaining conversions today |
| X-Rate-Limit-Limit | Total daily limit (100) |
429 Too Many Requests
{
"error": "Rate limit exceeded",
"message": "Free tier allows 100 conversions per day",
"limit": 100
}400 Bad Request
{
"error": "No file provided"
}413 Payload Too Large
{
"error": "File too large",
"message": "Maximum file size is 10MB",
"maxSize": 10485760
}For higher volume needs, consider running your own instance or using our web interface.
Try Web Converterfunction WebPConverter() {
const [converting, setConverting] = useState(false);
const handleConvert = async (file) => {
setConverting(true);
const formData = new FormData();
formData.append('file', file);
const response = await fetch(
'https://webp2jpg.co/api/convert?format=jpg',
{ method: 'POST', body: formData }
);
const blob = await response.blob();
const url = URL.createObjectURL(blob);
// Download or display converted image
const a = document.createElement('a');
a.href = url;
a.download = 'converted.jpg';
a.click();
setConverting(false);
};
return (
<input
type="file"
accept=".webp"
onChange={(e) => handleConvert(e.target.files[0])}
disabled={converting}
/>
);
}<?php
$file = $_FILES['image'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://webp2jpg.co/api/convert?format=jpg');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => new CURLFile($file['tmp_name'], $file['type'], $file['name'])
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
header('Content-Type: image/jpeg');
echo $result;
?>Monitor X-Rate-Limit-Remaining to avoid hitting limits
Check file extension before uploading to save quota
Implement retry logic with exponential backoff
Stay under 10MB limit by resizing large images