URL, HTTP & APIs
cURL to Fetch Converter
Paste a curl command — including the ones copied straight out of your
browser’s DevTools — and get clean, ready-to-paste fetch() JavaScript.
Everything is parsed in your browser; nothing is sent anywhere.
curl command
live
Multiline commands with \ line continuations, single or double quotes,
-X, -H, -d, --data-raw,
--data-urlencode, -F and -u are all supported.
Generated fetch()
JavaScriptHow it works
The command is tokenized the way a shell would treat it, then each option is mapped onto a
fetch() call. JSON and urlencoded bodies are detected from -d and
--data-raw, multipart fields from -F, query strings from
--data-urlencode with -G, and HTTP Basic credentials from
-u. Headers the browser controls (such as Host,
Cookie and Content-Length) are dropped with a note instead of
silently producing code that cannot run.