Skip to content
hateitall

cURL Converter

Turn a curl command from API docs or Copy as cURL into working code in the language you use.

Processed locallyIn: cURL, JavaScriptOut: JavaScript, Python, Shell

Loading tool…

How to use curl converter

  1. Paste a curl command, including line breaks and quotes as they are.

  2. Check the parsed method, URL, headers, auth and body.

  3. Pick fetch, Axios, Python, HTTPie or a tidy cURL version and copy the code.

  4. Switch direction to paste a fetch() call and get the curl command for it.

What this tool does

  • Reads bash quoting: single and double quotes, $'...' strings and backslash line breaks.
  • Understands -X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F, -u, -G, -I, -L, -A, -b, -e and grouped flags like -sSL.
  • Adds the Content-Type curl would add on its own, so the generated code sends the same request.
  • Lists every option it could not carry over, such as files referenced with @ or proxies.

How the result is verified

The request is written back out as cURL and parsed again; the page shows Round trip checked only when both parses give the same method, URL, headers and body.

Frequently asked questions

Does it work with Copy as cURL from Chrome DevTools?

Yes, with the bash version. Right-click a request in the Network panel, choose Copy, then Copy as cURL (bash), and paste it here.

Why does the output add a Content-Type header I did not write?

curl adds Content-Type: application/x-www-form-urlencoded whenever you use -d, and application/json for --json. fetch and the other libraries do not, so the header is written out to keep the request identical.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Build a correctly quoted curl command from a request form

URL · JSON · Text→ ShellLight on device

JavaScript fetch() code for any request, with JSON, forms and auth

URL · JSON · cURL→ JavaScriptLight on device

Axios request code with headers, data, auth and timeout

URL · JSON · cURL→ JavaScriptLight on device

Send GET, POST, PUT, PATCH and DELETE requests from your browser

URL · JSON · Text +→ ResponseModerate on device