Developer
cURL to Fetch
Paste a cURL command, including wrapped lines and quotes, and get a JavaScript fetch call with the method, headers and body.
Free forever.
How to convert a cURL command
- Paste the command, including backslash line breaks from a terminal or a browser’s copy-as-cURL.
- Convert it. Quoted headers and a JSON body are kept.
- Copy the fetch call. A JSON body is passed through JSON.stringify.
Questions
What is left out?
Flags that only affect curl itself, such as silent mode. -k does not turn certificate checks off, and a body or cookie that points at a file with @ has to be pasted instead.
How is -u user:password handled?
It becomes an Authorization: Basic header, encoded in the browser. The password is then visible in the generated code, so treat that code like the original command.
This runs entirely in your browser. Nothing you type is sent to a server.

