Curl Converter (curl ↔ Code)
Convert curl commands to JavaScript fetch, Python requests, Go, PHP, wget, HTTPie, and PowerShell — or build a curl command from method, URL, headers, and body. See the parsed request breakdown too. Runs in your browser.
Curl command
Request breakdown
- method
- POST
- url
- https://api.example.com/users
- headers
- Content-Type: application/json
- Authorization: Bearer TOKEN
- body
- {"name":"ada","role":"admin"}
Generated code
const res = await fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN"
},
body: "{\"name\":\"ada\",\"role\":\"admin\"}",
});
const data = await res.json();
console.log(data);How to use
- Parse mode: paste curl to see Request breakdown plus generated code.
- Or switch to Build mode and fill method, URL, headers, body.
- Copy the target code (fetch, Python, Go, PHP, wget, HTTPie, PowerShell) or built curl.
FAQ
Which curl flags are supported?
-X, -H, -d/--data variants, -u auth, -b cookies, -A agent, -G, -I, and --compressed. Exotic flags are ignored safely.
Is the generated code exact?
Semantics match (method, URL, headers, body, basic auth). Multipart uploads (-F) convert to a listed-fields note — adapt to your HTTP client.