Home › Tools

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

Secrets in the command (tokens, passwords, cookies) stay in this page: nothing is sent anywhere.

Last updated 2026-11-20.