Image Convert
Convert a base64-encoded image to a different format.
POST
10 credits
/v1/convert/image-convert
curl -X POST "https://convert.toolkitapi.io/v1/convert/image-convert" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"image": "iVBORw0KGgo...", "format": "jpeg", "quality": 85}'
import httpx
resp = httpx.post(
"https://convert.toolkitapi.io/v1/convert/image-convert",
json={"image": "iVBORw0KGgo...", "format": "jpeg", "quality": 85},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/image-convert", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"image": "iVBORw0KGgo...", "format": "jpeg", "quality": 85}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"image": "/9j/4AAQSkZJRgABAQEASABIAAD..."
}
Description
Convert a base64-encoded image to a different format.
How to Use
1
1. Base64-encode the source image and POST it in the `image` field (the MIME type is detected from the payload).
2
2. Set `format` to the target format.
3
3. Optionally set `quality` (for lossy formats).
4
4. Decode the base64 `image` in the response.
About This Tool
Converts an inline (base64-encoded) image to a different format. Supports PNG, JPEG, WebP, GIF, BMP, TIFF, and more. Great for on-the-fly image normalization in API-driven workflows.
For URL-based input or file-download output, use the [Image](/convert/tools/image) endpoint.
Why Use This Tool
- Normalization — Convert diverse user uploads to a single format
- Compression — Convert PNGs to JPEGs or WebPs for smaller storage
- Web delivery — Produce WebP for modern browsers
- Thumbnail pipelines — In-API format conversion without touching disk
Frequently Asked Questions
Is transparency preserved?
Yes when moving to transparency-capable formats (PNG, WebP, GIF). JPEG flattens transparency onto a white background.
What formats are supported?
PNG, JPEG, WebP, GIF, BMP, TIFF, ICO, and animated variants where applicable.
Is metadata preserved?
EXIF is preserved where the target format supports it.
Start using Image Convert now
Get your free API key and make your first request in under a minute.