Developer tool / 09
cURL to Code Converter
Convert cURL command strings into runnable JavaScript, Python, Go, and Node.js code snippets.
cURL to Code Converter: TOEA tokenizes and parses cURL flags (method, headers, body, basic auth) and dynamically formats equivalent code for JS fetch(), Python requests, Go net/http, and Node axios. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Copying a request from the browser
In the browser's developer tools, open the Network panel, right-click a request, and choose Copy as cURL. On Windows, pick the bash or POSIX variant; the cmd version escapes quotes with ^ and does not convert cleanly. The copied command includes every header the browser sent, including cookies and authorization tokens, which are live credentials. Remove them before sharing the generated code, along with browser-only headers such as sec-ch-ua that the request rarely needs.
What is carried over
The method, headers, body, and -u credentials are converted, and -A, -b, and -e become User-Agent, Cookie, and Referer headers. Repeated -d values are joined with & as curl joins them, and --data-urlencode values are percent-encoded. Like curl, -d without an explicit Content-Type sends application/x-www-form-urlencoded, so the generated code sets that header, while --json sets application/json. Commands split over several lines with a trailing backslash are read as one.
Some options have no counterpart and are skipped along with their values: multipart uploads with -F, proxies, output files, and timeouts. -G, -k, and --compressed are ignored, and -d @file is sent literally rather than read from disk. Mind redirects too: curl stays on the first response unless given -L, but fetch, requests, Go, and axios follow redirects by default.
How to use it
- Paste a cURL command string.
- Select a target programming language tab.
- Copy or download the generated code snippet.
Privacy & limitations
Parsing runs entirely inside your browser. No requests are sent over the network when converting commands.
Related tools
Frequently asked questions
Which cURL flags are supported?
Common request flags including -X/--request, -H/--header, -d/--data (repeated values are joined with &), --data-urlencode, --json, -u/--user, -A, -b, -e, and --url. Values of flags it cannot convert, such as -F or -o, are skipped.
Are my API keys or tokens sent to a server?
No. Conversion happens strictly in client memory without network interaction.
Free tool · runs in your browser · no account required