Emergency server help: get in touch

curl Command Converter

Turn a curl command into Python, JavaScript, Node.js, PHP, Go or wget code that sends the same request.

Where it runs
Runs in your browser
Last updated
October 9, 2026

Give this curl converter a curl command, for example one copied from your browser’s developer tools or an API’s documentation, and get equivalent code in Python requests, browser fetch, Node.js fetch, PHP cURL, Go net/http or wget. The tool understands quoting, line continuations, headers, data, forms, cookies, basic auth and common flags, and lists anything it had to ignore or could not express exactly in the chosen language. Parsing happens in your browser.

Loading the tool… It runs in your browser and needs JavaScript.

How to use the converter

Paste the command and pick a language. The Parsed request card shows the method, URL, headers and body the tool read, which is a quick way to spot a quoting mistake. Warnings appear under the code when something cannot be converted exactly, such as a shell variable, a cookie file or an option that has no equivalent.

Supported curl options

  • -X, -H, -A, -e, -b (cookie string), -u user:pass, --oauth2-bearer
  • -d/--data, --data-raw, --data-binary, --data-urlencode, --json, @file bodies, and -G to move data into the query string
  • -F and --form-string multipart forms, including @file, <file and ;type=
  • -k, -L, -I, -m, --compressed, --url, --url-query; output and progress options such as -s, -o and -w are listed as ignored

Like curl, the tool adds Content-Type: application/x-www-form-urlencoded when you send -d data without your own Content-Type, and switches the method to POST. Without that header, Python requests and fetch would send the body with a different type.

Quoting rules

Commands are read with Bash rules: single quotes are literal, double quotes allow backslash escapes, $'...' understands \n and \x41, and a backslash at the end of a line continues the command. Windows ^ and PowerShell backtick continuations are accepted too. An unquoted & in a URL ends the command in a real shell, so the tool stops there and warns you: put URLs in single quotes.

Differences between the languages

  • curl follows redirects only with -L. Without it, the code turns redirect following off too: allow_redirects=False in Python, redirect: 'manual' in fetch (in a browser that gives an opaque response with status 0), CheckRedirect in Go and --max-redirect=0 in wget. With -L each library follows redirects with its own rules for changing POST to GET.
  • The request body is copied exactly as written. JSON is not parsed and re-serialised, so large integers, duplicate keys, number formats and spacing stay the same, which matters for signed requests and webhooks.
  • Repeated -F fields keep their order (Python gets a list of pairs, not a dictionary). PHP’s array form cannot hold the same field name twice, so the PHP output leaves those fields out and says so. Python requests combines a repeated header into one value separated by commas; fetch does the same, while Go and PHP send it twice.
  • Browsers do not let scripts set Cookie, User-Agent, Host and some other headers, so the browser fetch version leaves them out and says so. The Referer becomes the referrer option.
  • -k (skip certificate checks) maps to verify=False, InsecureSkipVerify, CURLOPT_SSL_VERIFYPEER and --no-check-certificate. Use it only for testing; the better fix is a valid certificate.
  • wget cannot build multipart forms, so -F commands have no wget version.

For server admins

Turning a one-off curl test into a script is the common use: a health check that posts to a webhook, or a cron job that calls an API. Remember that credentials in -u or an Authorization header end up in the generated code; move them into environment variables before you commit it.

curl -sS -X POST "$WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  --data-raw '{"text": "Backup finished on web01"}'

curl Converter at a glance

curl Converter – short answer
In short: Turn a curl command into Python, JavaScript, Node.js, PHP, Go or wget code that sends the same request.
curl Converter – what this tool covers
curl Converter: what this tool covers.
curl Converter – questions answered
curl Converter: the questions this tool answers.

Related tools: HTTP Redirect Checker · HTTP Status Codes Reference · JSON Formatter and Validator · URL Encoder, Decoder and Parser.

Official documentation (checked 9 October 2026): curl man page · Requests: Quickstart · MDN: Window.fetch()

Frequently asked questions

Can I paste a command copied from browser developer tools?

Yes. Use “Copy as cURL (bash)” for best results. The Windows cmd variant also works for most commands.

Does the code send exactly the same body as curl?

Yes. The body is copied byte for byte with data=, body or POSTFIELDS. JSON is not re-encoded, because re-encoding can round large numbers, drop duplicate keys or change spacing, and a signed webhook would then fail its signature check.

Is the command sent anywhere?

No. It is parsed and converted in your browser, so tokens and passwords in it stay on your device.

Share this tool

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.