{ }Devtool

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

  1. Paste input or drop a file above.
  2. Adjust options (delimiter, dialect, quality, ratio).
  3. Copy result or download — no sign-up needed.

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.

Related format tools