Convert curl to Python, JavaScript, Go and PHP
Turn a curl command into ready-to-run Python, JavaScript (fetch), Node.js (axios), Go or PHP code. Supports -X, -H, -d/--data-raw/--data-binary/--data-urlencode, --json, -F file uploads, -u, -b, -L, -k, --compressed and multi-line commands.
🔒 Runs entirely in your browser. Nothing you paste is uploaded or sent to a server.
What gets converted
| curl option | Meaning | Becomes |
|---|---|---|
-X PUT |
request method | the method (default GET, or POST when there is a body) |
-H 'K: V' |
header | a header entry |
-d, --data-raw, --data-binary |
request body | the body; several -d are joined with & |
--json '{…}' |
JSON body | body + Content-Type/Accept: application/json |
--data-urlencode |
URL-encoded field | encoded name=value |
-F name=@file |
multipart form / upload | files= / FormData / CURLFile |
-u user:pass |
Basic auth | auth= / Authorization: Basic … |
-b 'a=1; b=2' |
cookies | cookies= or a Cookie header |
-G |
put -d data in the query string |
appended to the URL |
-L, -k, --compressed, -m, -x |
redirects, TLS, gzip, timeout, proxy | library options |
The command is parsed the way a POSIX shell would read it: single and double quotes, $'…' strings (which Chrome uses for bodies containing quotes or newlines), backslash escapes and \ line continuations all work. Each generated program was checked against real curl: it sends the same method, URL, headers and body.
Differences to keep in mind
- Redirects. curl does not follow redirects unless you pass
-L, but requests, fetch, axios and Go follow them by default. -dsets a form content type. curl sendsContent-Type: application/x-www-form-urlencodedwith-deven when the body is JSON. If your API expects JSON, add-H 'Content-Type: application/json'or use--json, otherwise the server may reply with a 415 or fail to parse the body (see JSONDecodeError: Expecting value).-kturns off certificate checks. Use it for testing only. The real fix for curl: (60) SSL certificate problem is to trust the right CA bundle.- Browsers are stricter than curl. A request that works with curl can still fail in the browser because of CORS, and browsers silently drop headers such as
Cookie,User-AgentandHost.
Secrets in the command (tokens, passwords, cookies) stay in this page: nothing is sent anywhere.
Last updated 2026-11-20.