Curl Converter
Curl Converter — runs in your browser. Inputs are not stored.
cURL → fetch
URL, -X, -H, -d/--data, -u Only basic options are parsed. Complex shell escaping and redirects are not supported.
How to use
- Paste a cURL command copied from browser DevTools or a terminal into the top box.
- Press Convert and review the JavaScript fetch snippet below.
- Use Copy result when you drop it into a project.
- If headers or the body are missing, check that
-Hand-dwere not split across quotes. - Reset clears the command so you can paste another request.
Key concepts
cURL to fetch is for turning a backend example into frontend code, or converting Copy as cURL from the Network panel into browser fetch. It reads the URL plus -X/--request, -H, -d/--data, and -u to build method, headers, and body. -u becomes a Basic Authorization header. Redirects, cookie files, certificates, and complex shell pipes are skipped.
One-liners and backslash-continued multi-line commands usually convert if they are ordinary REST calls. Output is built only in the browser and never sent to a server. Treat the snippet as a starting point and do not commit credentials. If you need a cookie session, add fetch options yourself.
Example
Example: curl -X POST https://api.example.com/v1 -H Content-Type: application/json -d {"ok":true} yields a POST fetch with a JSON body and a Content-Type header. User and password on -u add Authorization. Copy as cURL from DevTools is the most reliable input; hand-shortened commands often drop quotes. Before you commit the generated fetch, move tokens and cookies into environment variables. A GET with a body may be ignored by the server, so double-check method and body. When retrying the same input, reset first so old output does not mix in. On a shared computer, clear the field when you finish so the original command is not left on screen. Closing the tab discards what you pasted; you do not need to send a delete request to a server. Button names match the tool above, so you can follow this page as you go. If the result is empty, check required fields and that an error is not hidden. This is usage help, not a claim that input is stored elsewhere. On mobile, the copy button may ask for clipboard permission—allow it and tap again.
Related: URL parser · JSON formatter · JWT decoder
Frequently asked questions
Does every cURL option convert to fetch?
No. Advanced options such as redirects, cookie files, and certificates are skipped. It is meant for basic REST calls.
Can I paste Copy as cURL as-is?
Usually yes. If shell quotes are broken, headers get truncated—scan the command once.
How is Basic auth -u converted?
It becomes an Authorization header with a Basic value. The password remains in the code, so be careful.
Is the converted command logged on a server?
No. Parsing happens only in the browser.
Do --data-raw and multipart work?
It focuses on simple <code>-d</code>/<code>--data</code> bodies. File-upload multipart may not match what you expect.
Does it also output axios instead of fetch?
This screen only builds a fetch snippet. You can adapt it to axios yourself.
Last reviewed: 2026-09-04