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.
Table of Contents
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,@filebodies, and-Gto move data into the query string-Fand--form-stringmultipart forms, including@file,<fileand;type=-k,-L,-I,-m,--compressed,--url,--url-query; output and progress options such as-s,-oand-ware 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=Falsein Python,redirect: 'manual'in fetch (in a browser that gives an opaque response with status 0),CheckRedirectin Go and--max-redirect=0in wget. With-Leach 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
-Ffields 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
referreroption. -k(skip certificate checks) maps toverify=False,InsecureSkipVerify,CURLOPT_SSL_VERIFYPEERand--no-check-certificate. Use it only for testing; the better fix is a valid certificate.- wget cannot build multipart forms, so
-Fcommands 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



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.