How to use the cURL Converter
- Paste a curl command into the left box. Multi-line commands with
\(bash) or^(Windows) line breaks work too. - Choose JavaScript fetch, Axios or Python requests.
- Check the summary under the code: method, URL, headers and body type, plus notes on anything that couldn't be converted.
- Click Copy and paste the code into your project.
Copy as cURL from your browser
The fastest way to reproduce a request a web page makes: open developer tools (F12), go to the Network tab, right-click the request and choose Copy → Copy as cURL. Chrome on Windows offers cmd and bash versions; both can be pasted here. Copied requests often include many browser headers (sec-ch-ua, sec-fetch-*, accept-language) that you can usually delete.
What gets converted
| curl | Meaning | In the code |
|---|---|---|
-X, --request | HTTP method | method (POST is assumed when there's a body) |
-H, --header | Header | headers |
-d, --data, --data-raw, --json | Request body | JSON is turned into an object; a=1&b=2 into form fields |
--data-urlencode | URL-encoded field | Encoded and added to the body |
-F, --form | Multipart form and file upload | FormData / files= |
-u, --user | Basic auth | Authorization: Basic / auth |
-b, --cookie | Cookies | Cookie header / cookies= |
-G, --get | Send data in the query string | Added to the URL / params= |
-L, -k, -m | Follow redirects, skip TLS checks, timeout | Redirect, TLS and timeout options |
fetch, Axios or requests?
fetch is built into every browser and into Node.js 18 and later, so it needs no install. Axios adds automatic JSON handling, timeouts and interceptors and works the same in old browsers and Node. Python requests is the standard choice for scripts, tests and data work. See cURL to Python for Python-specific tips.
Redirects
curl does not follow redirects unless you add -L, while fetch, Axios and requests follow them by default. That's usually what you want, so the generated code keeps the default. If you need to see the redirect itself, add redirect: "manual" (fetch), maxRedirects: 0 (Axios) or allow_redirects=False (requests).
Frequently asked questions
Is my curl command sent anywhere?
No. It's parsed and converted in your browser. That matters because copied commands often contain tokens, cookies and passwords.
Why does the browser block my fetch call when curl works?
Browsers enforce CORS: the server has to allow requests from your page's origin. curl, Node.js and Python don't have that limit. Run the code on a server, or ask the API owner to allow your origin.
Can I convert to Node.js?
Yes. Choose JavaScript fetch: Node.js 18 and newer have fetch built in. Axios also works in Node.
What about -k / --insecure?
Python gets verify=False and Axios gets an HTTPS agent that skips certificate checks. Browsers never allow skipping them. Only use this for local testing.
My command has several URLs or uses a config file.
Only the first URL is converted, and -K config files can't be read. Anything skipped is listed under the code.
Updated