Developer Tools
cURL Converter: Turn curl Commands into Code
Convert curl commands to JavaScript fetch, axios, Python requests, Go, PHP, Java, C#, and Rust code.
Runs locally in your browser — your input is not uploaded.
What is this tool?
Browsers and API docs let you copy requests as curl, but you need them in code. Paste any curl command and get equivalent code for eight languages, with headers, JSON bodies, form uploads, basic auth, cookies, and redirect settings carried over.
The converter understands common options including -X, -H, -d, --data-raw, --data-urlencode, --json, -F, -u, -b, -A, -e, -G, -I, -L, -k, and --compressed, as well as quoted strings, $'…' strings, and line continuations for bash and Windows.
JSON bodies are turned into native objects where the language makes that natural, such as json= in Python requests. Tokens and cookies in your command stay in your browser — nothing is uploaded.
How to use the cURL Converter
- Paste a curl command — for example from your browser's developer tools (right-click a request → Copy as cURL).
- Pick the language: fetch, axios, Python, Go, PHP, Java, C#, or Rust.
- Review the generated code; options that have no equivalent are listed so nothing is silently lost.
- Copy or download the code and drop it into your project.
Examples
curl to Python
curl https://api.example.com/items -H 'Accept: application/json'
import requests
headers = {
"Accept": "application/json",
}
response = requests.get("https://api.example.com/items", headers=headers, allow_redirects=False)Frequently asked questions
How do I copy a request as curl?
Open developer tools (F12), go to the Network tab, right-click the request, and choose Copy → Copy as cURL. In Windows, choose the bash version for the best results.
Is it safe to paste commands with API keys?
The conversion runs entirely in your browser, so keys aren't sent anywhere. Still, remember to remove secrets before sharing the generated code.
Why does Python show allow_redirects=False?
curl doesn't follow redirects unless you pass -L, so the code matches that behaviour. Add -L to the command to follow redirects.
Are file uploads supported?
Yes. -F field=@file.png becomes a multipart upload in each language, referencing the same file name.
Want more power later?
Premium tools, higher limits, and API access are on the roadmap. V1 stays free and private in your browser.