curl to Code Converter
Paste a curl command, from DevTools or an API's docs, and get the same request as JavaScript fetch, Laravel's Http client, Python requests or Go net/http.
Free · No sign-up · Your inputs stay in your browser
Input
Convert a curl command to code
Output
Result
POST https://api.example.com/v1/orders?expand=items
-H, -d and its variants, --json, -F, -u, -A, -b, -G, -k and -L are translated; output-only flags such as -s, -o and -v are dropped. A command copied from DevTools often carries session cookies and tokens: they stay in this tab, but take them out before pasting the code anywhere else.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Copy as cURL
Every browser's DevTools can copy a network request as a curl command, with every header the browser sent. That is the fastest way to reproduce a request outside the browser, and converting it gives working client code. Remove the cookies and tokens it carries before sharing the result.
What changes between languages
curl follows no redirects unless given -L, which the converted code keeps by disabling redirects where the language follows them by default. JSON bodies become native objects in each language: Laravel's Http::post($url, [...]) sends an array as JSON, and Python's requests does it with json=. The flags themselves are documented in the curl manual.