Skip to content
HQ8T

cURL to Code

Convert cURL to fetch, axios, Python, PHP or Go.

POST https://api.example.com/v1/orders?limit=10 · 2 headers · body

const res = await fetch("https://api.example.com/v1/orders?limit=10", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "item": "Notebook",
    "qty": 2,
    "gift": false
  }),
});
const data = await res.text();

Converted in your browser — tokens and passwords in the command never leave your device. Supports -X, -H, -d / --data-raw / --data-urlencode / --json, -F, -u, -b, -G, -k and -L.

How to use

  1. 1Paste a cURL command (from Chrome DevTools: right-click a request → Copy as cURL).
  2. 2Pick a language.
  3. 3Check the method, URL and headers summary.
  4. 4Copy the generated code.

Frequently asked questions

Which cURL options are supported?

-X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F (multipart), -u (basic auth), -b (cookies), -G, -k and -L.

Is JSON body detected?

Yes. A JSON body becomes JSON.stringify in JavaScript and json= in Python requests.

Is my API token safe?

Yes. Conversion happens in your browser and the command is never sent anywhere.

Does it handle Windows commands?

Commands with ^ line continuations from Windows Copy as cURL (cmd) work; bash format is best.

Is my data uploaded?

No. Everything runs in your browser; nothing you paste is sent to a server.