image→toolbox

Image Conversion API

Convert and compress images from your own code, or from an automation tool like Pipedream. Send an image, and the new one comes back in the response.

Ask for a key

Keys are free and come by email. Each one sends 100 images a day, and more if you need it.

Your first request

This turns an iPhone photo into a JPG and saves it next to the original.

curl "https://imagetoolbox.org/api/v1/convert?format=jpg&name=IMG_4127.HEIC" \
  -H "Authorization: Bearer $IMAGETOOLBOX_KEY" \
  --data-binary @IMG_4127.HEIC \
  -o IMG_4127.jpg

The image goes in as the body, and the converted one comes back as the response. A form upload works too, with the image as its only file.

Convert

POST /api/v1/convert

Parameters for convert
formatRequired. One of jpg, png, webp, avif.
qualityFrom 1 to 100, and 90 if you leave it out. PNG is lossless, so it makes no difference there.
nameOptional. The original file name, so IMG_4127.HEIC comes back as IMG_4127.jpg. Without it, a form upload's file name is used, or else image.jpg.

It reads HEIC, JPG, PNG, WebP, AVIF, GIF and TIFF. JPG has no transparency, so transparent areas turn white.

Compress

POST /api/v1/compress

It finds the highest quality that fits under the size. Only when even the lowest quality won't fit is the picture made smaller in pixels too.

Parameters for compress
max_kbRequired. The most the result may weigh, from 10 to 10240 KB.
formatOne of jpg or webp, and jpg if you leave it out.
nameOptional. The original file name, as for convert.
curl "https://imagetoolbox.org/api/v1/compress?max_kb=500" \
  -H "Authorization: Bearer $IMAGETOOLBOX_KEY" \
  -F [email protected] \
  -o holiday-small.jpg

What comes back

You get the new image back, with what it is in the headers.

Response headers
Content-DispositionThe file name to save it under.
X-Image-Width
X-Image-Height
Its size in pixels, after any shrinking.
X-Image-FormatWhat it was written as, such as webp.
X-Image-QualityThe quality it was written at. Left out for PNG.
X-Source-FormatWhat the image you sent really was, read from its bytes rather than its name.
X-Original-BytesHow big the image you sent was.
RateLimit-Limit
RateLimit-Remaining
RateLimit-Reset
Images a day, images left, and seconds until midnight UTC. They come with a 422 or a 429 too.

Your key

GET /api/v1/key

This says how much the key has left today, and it doesn't count as an image. Send the key the same way, as Authorization: Bearer.

{
  "id": "k_1a2b3c4d",
  "name": "Product photos",
  "limit": 100,
  "used": 12,
  "remaining": 88,
  "resets": "2026-11-08T00:00:00.000Z"
}

Errors

An error comes back as JSON, with a code to test for and a message you can show as it is.

{
  "error": {
    "code": "invalid_key",
    "message": "That key isn't valid, or it has been revoked."
  }
}
Error codes
400 bad_formatThe format is missing, or not one this endpoint writes.
400 bad_qualityquality is not a whole number from 1 to 100.
400 bad_sizemax_kb is missing or out of range.
400 no_imageThe request had no body, or the form had no file.
400 bad_formThe multipart form couldn't be read.
401 missing_keyNo Authorization header with a key.
401 invalid_keyThe key is wrong, or it has been revoked.
404 not_foundThere is no endpoint at that address.
405 method_not_allowedWrong method. The Allow header says which to use.
413 too_largeThe image is larger than the API takes.
415 not_an_imageThe body isn't an image this can read.
415 unsupported_formatBMP, ICO or SVG, which only the website reads.
422 damagedThe image is broken, or too slow to decode.
422 too_many_pixelsThe picture has more than 100 million pixels.
422 too_wide_for_webpWebP stops at 16,383 pixels on a side.
422 cannot_fitThe picture can't get under max_kb, even made much smaller.
422 cannot_convertAnything else about the image that can't be done.
429 daily_limitThe key has used today's images. Retry-After says when that changes.
500 server_errorSomething broke on our side. It doesn't count against the key.
503 busyToo much is being converted at once. Retry-After says when to try again.

Limits

A key sends 100 images a day, counted from midnight UTC. Every image counts, whether or not it could be converted, unless the fault was ours.

An image can be 25 MB at most. Two images are converted at a time for everyone together, and up to ten more can wait their turn.

With ten already waiting, a new request gets a 503 with Retry-After: 30 before its image is read, and it doesn't count.

What happens to your images

The tools on this website run in your browser. The API can't, because your code sends the image to us, so it's converted in memory on our server in France.

The new image goes back in the same response, and nothing is written to disk or kept. Requests reach our server through Cloudflare, so images pass through its network on the way.

The log notes the endpoint, the status, the key's ID, the sizes and how long it took, never a file name. An error on our side is logged too, without the image.

For each key we keep the name and email address it went to. The privacy policy has the rest.

Common questions

Is the image API free?

Yes. Keys cost nothing and each one sends 100 images a day. If you need more, say what for when you ask, and a key with a higher limit is just as free.

Does the API keep my images?

No. Your image is converted in memory and sent back in the same response, and then it's gone. It's never written to disk, and the log never notes a file name.

Which languages can use the API?

Any that can send an HTTP request. It's one POST with the image as the body and a key in a header, so curl works as it is, and so does the HTTP library in any language.

The website is free to use, with no account and no limits. Every tool on it runs in your browser, and your files never leave your device.