Convert cURL Commands to Code in 10 Languages
Paste a cURL command from your terminal, API docs, Postman or your browser’s DevTools (“Copy as cURL”), and get ready-to-run code that sends the same request. The converter understands what real-world commands contain, not just the simple cases.
Supported languages
- Python (requests), JavaScript (fetch) and Node.js (axios)
- Go (net/http), PHP (cURL extension), Java (HttpClient) and C# (HttpClient)
- Ruby (Net::HTTP), Rust (reqwest) and PowerShell (Invoke-WebRequest)
- A JSON view of what was parsed, which helps when debugging a command
What it understands
- Chrome and Firefox “Copy as cURL (bash)” output, including
$'…'strings, and the Windows cmd version with^escapes - Combined and attached flags such as
-sSLXPOSTand-H'Accept: json' - JSON bodies,
--data-urlencode,--data-raw,--json,@filebodies and-Tuploads - Multipart uploads with
-F, including file parts, content types and file names - Basic auth, bearer tokens, cookies,
-G,-I, redirects (-L), timeouts, proxies and-k
Accurate output
The generated programs send the same method, URL, headers and body as your command. We run them against real cURL to check this for every supported language. Like cURL, the code doesn’t follow redirects unless you used -L, and it shows warnings for options it can’t carry over, such as digest authentication or client certificates.
Tips
- In Chrome or Edge, right-click a request in the Network tab, choose Copy → Copy as cURL, and paste it here.
- Replace tokens, passwords and file paths in the generated code before you share or commit it.
- Your command is converted in your browser and never sent to our servers.