cURL to Code Converter

Convert curl commands to JavaScript fetch, Python requests, PHP cURL and Node.js axios code.

Runs instantly in your browser — results update as you type.

How do I convert a curl command to Python or JavaScript?

Paste the curl command (for example one copied from browser DevTools via “Copy as cURL” or from API docs) and the tool parses the URL, method, headers, body and authentication and writes equivalent code for fetch, Python requests, PHP and axios.

Supported options

-X, -H, -d / --data / --data-raw, -F form fields, -u basic auth, -A user agent, -b cookies, -e referer, --compressed and -k. Flags that do not affect the request (-s, -L, -v) are ignored.

JSON bodies are converted to native objects (Python dicts, JavaScript objects) so they are easy to edit.

Frequently asked questions

Does it run the request?

No, it only converts the command — nothing is sent anywhere.

Are line breaks with \ supported?

Yes, multi-line commands (\ on Linux/macOS, ^ on Windows) are joined automatically.

Is my API token safe?

The conversion happens in your browser, but remove real secrets before sharing the code.