cURL to Code
Copy a request from DevTools, the terminal or a bug report — get runnable code in eight languages.
—
Why convert cURL instead of writing the request again
The fastest way to reproduce a request is to copy it as cURL — Chrome, Firefox and Safari all
offer “Copy as cURL” in the network panel, and API docs, bug reports and support tickets are
full of them. But cURL is a terminal command, not code. Translating it by hand means
re-typing every header, getting the quoting right in another language, and quietly losing a
-u or a --compressed along the way.
This converter parses the command properly: line continuations, single quotes, double quotes,
ANSI-C $'…' strings, clustered flags like -sSL,
--flag=value form, repeated -H and -d, multipart
-F fields, basic auth, cookies and TLS flags. It then generates the equivalent
request for eight targets.
FAQ
Why can't my browser fetch set the Cookie or Host header?
Browsers treat Cookie, Host, Origin and a few other headers as forbidden — the fetch API silently drops them. The same code works unchanged in Node.js 18+, which is what the “axios” tab shows as well.
What happens to -d @file.json?
Reading the file happens in the shell, so the converter cannot see its contents. It flags the reference so you can paste the file's body in place of the placeholder.
Is my API token sent anywhere?
No — the cURL command is parsed entirely in your browser. That matters here: cURL commands routinely contain bearer tokens, session cookies and API keys.
Why does the generated code sometimes add Content-Type?
If the body is valid JSON but the command has no -H 'Content-Type: application/json', cURL would send application/x-www-form-urlencoded and most APIs would reject it. The converter uses the JSON content type and says so in the status line.