cURL to Code
Turn a curl command into fetch, axios, Python requests or httpx, Go, Rust or PHP code.
- Never uploaded
- Works offline
- Free, no sign-up
Processed on this device. Nothing is sent to a server.
How to use the cURL to Code
- Step 1Paste a curl commandFrom API docs, or “Copy as cURL” in your browser’s dev tools.
- Step 2Pick a languageJavaScript, Python, Go, Rust or PHP. Your choice is remembered.
- Step 3Copy the codeNotes list anything that couldn’t be converted.
What gets converted
The converter reads the URL, method (-X), headers (-H), request body (-d, --data-raw, --data-binary, --data-urlencode, --json), multipart forms and file uploads (-F), basic auth (-u), cookies (-b), user agent and referer, query data with -G, timeouts (-m), redirects (-L) and -k.
JSON bodies become native objects in each language, such as a dict passed as json= in Python or serde_json::json! in Rust, so they’re easy to edit. Commands copied from Chrome, Firefox or Safari work as they are, including line continuations from bash, Windows cmd and PowerShell.
Questions
Is it safe to paste a command with my API key?
Yes. The command is converted by JavaScript in this tab and never sent anywhere. API keys and cookies in “Copy as cURL” output stay on your device.
How do I get a curl command from my browser?
Open developer tools (F12), go to the Network tab, right-click the request and choose Copy → Copy as cURL. On Windows, pick the “bash” variant if offered.
Was the generated code tested?
Yes. Our test suite sends the same request with real curl, the generated JavaScript and the generated Python to a local server and checks that method, path, headers and body match exactly.
Why are some options listed as not converted?
Some curl flags have no equivalent in a library call, such as progress bars, writing output to a file, or proxies. They are listed under the code so nothing is silently dropped.