cURL to Fetch Converter
cURL to Fetch Converter turns a copied cURL command into a JavaScript fetch call with the headers, body and authorization it carries. It runs in your browser, so tokens in the command are never uploaded.
How to use cURL to Fetch Converter
- In your browser's network panel, right-click a request and choose “Copy as cURL”, then paste it here.
- Choose how the response should be read in the generated code.
- Copy the fetch code. Read any notes at the top, as they list options fetch cannot reproduce.
Frequently asked questions
Is my cURL command uploaded?
No. The command is converted in your browser. This tool also keeps it out of shareable links, because commands often contain tokens and passwords.
Which cURL options are supported?
Method, headers, request bodies (-d, --data-raw, --data-binary, --data-urlencode, --json), form fields (-F), basic and bearer auth, cookies, user agent and referer. Options with no fetch equivalent, such as --insecure or proxies, are listed in a note instead of being dropped silently.
Why does the code mention headers browsers refuse to set?
Browsers do not let page code set headers such as Cookie, Referer or Sec-Fetch-*. They work in Node.js, Deno and Bun. You can leave them out with the option above the output.
Does it read the Windows cmd version of Copy as cURL?
No. It reads the bash-style command, which uses single quotes or $'…' strings. In Chrome, choose “Copy as cURL (bash)”.
Next step
Going the other way? Turn fetch code back into a cURL command. Open Fetch to cURL Converter.
Related tools
- 132