cURL to code converter
Turn a curl command into runnable Python, JavaScript or Node.js code.
cURL to code converter
Paste a curl command and get back the same request as clean, runnable code. Pick Python with the requests library, browser fetch, or Node.js with its built-in fetch, and the converter rewrites the URL, method, headers, request body and basic auth into idiomatic code for that language. It is the fastest way to move a request out of your terminal or out of an API doc and into an actual script.
The parser handles the things people really copy: commands split across several lines with trailing backslashes, single- and double-quoted arguments, multiple -H headers, and -d, --data or --data-raw bodies. When the body is JSON it is passed the right way for each target — json= in Python, JSON.stringify in fetch — instead of a raw string you have to fix by hand. The method is taken from -X, or inferred as POST when there is data and GET otherwise. A -u user:password becomes a proper auth tuple or an encoded Authorization header. Noise like --compressed, -s and -L is quietly dropped, since it does not change the request.
This is a text transformation, not an HTTP client. The tool reads the command as text and writes code — it never opens the URL, never sends the request, and nothing you paste leaves your browser. That matters, because a curl command copied from dev tools often carries a session cookie, an API key or a bearer token in its headers, and those stay on your machine.
Choose the language, copy the result, or download it as a file. Change the target and the same command is rewritten instantly, so you can compare how the request looks in each language.