Paste a curl command — get Python requests, JavaScript fetch, and Node axios
-d forms become data=/URLSearchParams, -u becomes basic auth, and -G, --compressed, -k, and -m map to each client's idiomatic option. Commands with real shell syntax ($(), pipes, FOO=bar prefixes) are parsed with the actual bash grammar — tree-sitter WebAssembly, lazily fetched from the CDN only when needed — with an offline tokenizer as the fallback.
-H to headers, JSON -d to a real body, -u to auth, -F to multipart, and -m to a timeout in all three targets. Parsing runs entirely in your browser — tree-sitter-bash (MIT, WebAssembly) loads on first paste, with a built-in tokenizer as fallback. Nothing is sent to a server.| curl flag | What it does | Python requests | JS fetch | Node axios |
|---|---|---|---|---|
-X, --request | HTTP method | requests.post(...) | method: | axios.post(...) |
-H, --header | Request header | headers={} | headers: {} | headers: {} |
-d, --data (JSON) | Request body | json={} | JSON.stringify() | object arg |
-d (k=v pairs) | Form body | data={} | URLSearchParams | URLSearchParams |
-F, --form | Multipart upload | files={} | FormData | FormData |
-G, --get | Move -d to query | params={} | query in URL | params: {} |
-u, --user | Basic auth | auth=(u, p) | btoa() header | auth: {} |
-b, --cookie | Cookies | Cookie header in all three | ||
-A, --user-agent | User agent | User-Agent header in all three | ||
-m, --max-time | Timeout (s) | timeout= | AbortSignal.timeout() | timeout: (ms) |
-k, --insecure | Skip cert check | verify=False | comment (browsers won't) | comment |
-L, --location | Follow redirects | default behavior in all three | ||
--compressed | Request compression | automatic in all three | ||
-I, --head | HEAD request | HEAD method in all three | ||
The tool treats your paste as what it is — a shell command — instead of guessing with regexes. On first input it lazily loads tree-sitter's bash grammar compiled to WebAssembly (both MIT licensed, served from a CDN) and parses the command into an exact token list: quoting styles, escapes, and backslash line continuations included. A built-in tokenizer produces the same tokens if the CDN is unreachable, so the tool always works offline-ish. The token list becomes a request model (method, URL, headers, body type, auth, options), and three code generators turn that model into runnable Python, browser JavaScript, and Node.js.
'single', "double", $'ansi-c' — plus adjacent-segment concatenation like 'Authorization: Bearer '"$TOKEN"-sL), attached values (-XPUT, -H'X: 1'), and --flag=value long forms-d parts (joined the way curl joins them), duplicate -H headers, and implied-POST semantics$(...) substitutions — kept literally, with a warning, since no static converter can know their valuesTake a typical authenticated POST:
curl -X POST https://api.example.com/v1/users \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer tok_123' \
-d '{"name":"Ada","role":"admin"}'The parser reads four arguments after curl: the method, two headers, and a JSON body it can parse structurally. Python output:
import requests
url = "https://api.example.com/v1/users"
headers = {
"Authorization": "Bearer tok_123",
}
json_data = {
"name": "Ada",
"role": "admin",
}
response = requests.post(url, headers=headers, json=json_data)
print(response.status_code)
print(response.text)Note the Content-Type header disappeared: requests sets it automatically when you pass json=, and re-sending it would be redundant. The fetch version uses body: JSON.stringify(...) for the same reason, and the axios version passes the object as the second argument. Paste the command above into the tool to see all three side by side.
API tokens routinely ride inside curl commands copied from internal docs. This page never sends your paste anywhere — the parser is WebAssembly running locally, the same architecture the popular MIT-licensed curlconverter project uses. If you're pasting a command with a production bearer token, that's the difference worth knowing about.
Paste the full curl command into the converter above and switch to the Python tab. The tool maps -H headers to a headers dict, JSON -d bodies to a json= argument, form bodies to data=, -u to auth=, and -m to timeout=, then emits a complete requests script you can run as-is.
Paste the command and pick the JavaScript fetch tab. The method, headers, and body are rewritten as a fetch() call: JSON data becomes JSON.stringify(...), form data becomes URLSearchParams, and -m --max-time becomes AbortSignal.timeout(). The Node axios tab covers axios-style projects.
No. Parsing and code generation happen entirely in your browser. The parser itself (tree-sitter-bash compiled to WebAssembly, MIT licensed) loads from a CDN the first time you paste; if that fails, a built-in tokenizer takes over. Nothing you paste is transmitted.
That's curl's own behavior: any -d/--data, --data-raw, --data-binary, or -F/--form flag implies POST unless you override with -X. The converter follows the same rule, and -G flips it back to GET by moving the data into the query string.
The common set: -X method, -H/--header, -d/--data/--data-raw/--data-binary/--data-urlencode, -F/--form, -u/--user, -b/--cookie, -A/--user-agent, -e/--referer, -G/--get, -I/--head, -L/--location, -k/--insecure, --compressed, -m/--max-time, --url, quoting styles ('...', "...", $'...'), and backslash line continuations. Unsupported flags are listed in a comment so nothing disappears silently.
A shell command with $TOKEN can't be converted to a literal value without running the shell — the converter doesn't know what the variable holds. It keeps the reference ($TOKEN) in the generated code and warns you, so you can substitute a real value or read it from an environment variable in the target language.