Turn a cURL command into Python, JavaScript or Go code.
Saved you some time? ☕ Buy me a coffee
API documentation and browser developer tools usually give you a cURL command. This converter reads that command and writes the equivalent request in the language you are working in, including the method, URL, headers, body, authentication and file uploads.
Paste a command that begins with curl into the left box and pick a target language. Multi-line commands with backslashes are supported. In Chrome or Firefox you can get a command from the Network tab by right-clicking a request and choosing Copy as cURL (use the bash variant on Windows).
The converter handles -X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F, -u, -A, -e, -b, -G, -I, -k and --max-time. When an option cannot be converted, a warning appears above the result so nothing is dropped silently. Shell variables and command substitution are not expanded.
Treat the output as a starting point. Move API keys and tokens into environment variables before you commit the code, add error handling for non-successful status codes, and remove browser-specific headers you do not need. Redirect behavior also differs: Python, fetch, Axios and Go follow redirects by default, while cURL only does so with -L.
The command is processed in your browser and is not uploaded. Still, avoid pasting production secrets into any website when you can use a placeholder.
Use the bash form of Copy as cURL. The Windows cmd form uses different quoting and is not supported.
Browsers apply CORS rules and block some headers. The same code usually works in Node.js.
Form fields that start with @ are converted to file uploads. In JavaScript you need to supply the file contents yourself.