cURL to Fetch Converter

Paste a curl command, get ready-to-use JavaScript fetch() code.

This free online curl to fetch converter parses the method, URL, headers, body, and basic auth from a curl command copied out of API docs or a browser's "Copy as cURL" and turns it into clean fetch() JavaScript. No signup required, runs entirely in your browser.

curl command
fetch() code

Frequently asked questions

Paste your curl command above. It's parsed for the HTTP method, URL, headers, body, and basic auth, and a ready-to-use fetch() call is generated instantly — nothing is sent to a server.
-X / --request for the method, -H / --header for headers (repeatable), -d / --data / --data-raw / --data-binary for the body, and -u / --user for basic auth (converted to an Authorization: Basic header). The URL is read from the first non-flag argument.
Multipart form uploads (-F / --form), cookies (-b / --cookie, -c / --cookie-jar), client certificates, --resolve, and retry/timeout flags aren't converted — fetch() has no direct equivalent for most of these, so they're intentionally left out rather than guessed at.
Because curl doesn't either. Without an explicit Content-Type header, -d sends application/x-www-form-urlencoded by default, even for a JSON-looking body. This tool mirrors that exactly — it only adds Content-Type if your curl command set one.
No. Everything is parsed and converted locally with JavaScript in your browser. Nothing is uploaded or stored on a server.