cURL Converter

Convert a curl command into JavaScript fetch, axios, Python requests, PHP cURL, Go net/http, or Node.js code. Parses method, headers, JSON and form bodies, basic auth, and cookies entirely in your browser.

cURL Converter

Convert a curl command into fetch, axios, Python, PHP, Go, or Node code

Characters: 0

Paste a curl command above to see the generated JavaScript (fetch) code here

Parsing runs entirely in your browser. Nothing is sent to a server. Supports method, headers, JSON and form bodies, basic auth, cookies, and user agent.

What is a cURL Converter?

A cURL converter takes a curl command and rewrites it as equivalent code in another language or HTTP client. Developers copy curl commands from API documentation, Postman, or the browser "Copy as cURL" option, then need the same request as JavaScript fetch, Python requests, or PHP. Translating headers, the HTTP method, and the request body by hand is slow and easy to get wrong.

CodeHelper's cURL Converter parses the command in your browser and generates clean, ready to paste code for six targets: JavaScript fetch, axios, Python requests, PHP cURL, Go net/http, and Node.js https.

Key Features

  • Six output targets: fetch, axios, Python requests, PHP cURL, Go, and Node.js, switchable with one click.
  • Smart parsing: detects the method, headers, query string, and request body, including JSON and form-urlencoded payloads.
  • Auth and cookies: converts -u basic auth, -b cookies, and -A user agent into the right headers.
  • Browser copy support: handles multiline commands, line continuations, and the ANSI-C quoting Chrome and Firefox use in "Copy as cURL".
  • 100% client-side: the command never leaves your browser, so it is safe for requests that contain tokens.

How to use the cURL Converter

  1. Paste your curl command into the input area.
  2. Pick the target language or HTTP client.
  3. The equivalent code is generated instantly.
  4. Copy the output or download it as a file.

Whether you are porting an API example to a new stack, debugging a request, or sharing a snippet with your team, this free tool turns any curl command into working code in seconds.

Need an endpoint to try the generated code against? The development APIs and open data APIs in the CodeHelper directory list which ones work without a key.

Frequently Asked Questions

How do I convert a curl command to Python requests?

Paste the curl command, including headers, cookies and the -d or --data body, and pick Python in the language list. The converter maps the method, URL, headers, query string and body to a requests call and formats JSON bodies as a dictionary, ready to paste into a script.

Which curl options are supported?

The common ones: -X and --request, -H and --header, -d, --data, --data-raw, --data-binary and --data-urlencode, -F for multipart forms, -u for basic auth, -b for cookies, -k for insecure, -L for redirects, -A for the user agent and --compressed. Options that only affect the curl CLI output, such as -s, -v or -o, are ignored.

Can I paste a curl command copied from browser DevTools?

Yes. Chrome, Firefox and Safari export requests as cURL with every header and cookie, and the converter parses that format directly, including the bash line continuations. Remove the session cookies before sharing the generated code.

Is my curl command sent to a server?

No, parsing and code generation run entirely in your browser, so tokens and cookies inside the command never leave your machine.

Free forever, no ads, no tracking. Support the project