Curl to code converter

Copy a request as curl from your browser dev tools or API docs, paste it here and get ready-to-run code in your language.

Private: works in your browser, nothing is uploaded.

How to use the Curl to Code tool

  1. Paste a curl command. Multi-line commands with backslashes work.
  2. Pick the language: Python, JavaScript, Node.js, Go or PHP.
  3. Copy the generated code into your project.

Supported curl options

  • -X / --request, -H / --header, -A, -e, -b (cookies)
  • -d, --data, --data-raw, --data-binary, --data-urlencode, --json
  • -F / --form for multipart uploads
  • -u for basic authentication, -G to move data into the query string
  • -k (insecure), -L (follow redirects), -I (HEAD), --compressed

Copy as cURL from the browser

In Chrome, Edge or Firefox open the developer tools, go to the Network tab, right-click a request and choose “Copy as cURL (bash)”. Paste it here to reproduce the same request in a script. Remove cookies and tokens you do not need before sharing the code.

Privacy

Everything runs in your browser. Your files and text are not uploaded to our server or stored anywhere. Commands often contain API tokens, so the conversion happens locally and nothing is sent.

Frequently asked questions

Does it run the request?

No. It only converts the command to code. Nothing is sent to the URL.

Is JSON body detected?

Yes. When the Content-Type is JSON and the body is valid JSON, Python uses json= and JavaScript uses JSON.stringify with a readable object.

Does it support Windows cmd curl?

Bash style commands work best. Commands from cmd with ^ line breaks and double quotes are also handled in most cases.

What about file uploads?

Form fields like -F file=@photo.jpg become files= in Python, FormData in JavaScript and CURLFile in PHP.