Skip to content
Engyna

curl Converter

Turn curl commands into fetch, axios, Python, Go, PHP, Node, HTTPie or wget code, or build a request and get the curl command.

How to use the curl Converter

  1. 1Paste a curl command, for example from your browser's "Copy as cURL". Quotes, line breaks and repeated -H flags are handled.
  2. 2Check the request builder: method, URL, query parameters, headers, auth and body can all be edited there.
  3. 3Pick the language, from fetch and axios to Python, Go, PHP, Node, HTTPie and wget, and copy the code. Choose curl to turn a request you built into a curl command.

About curl Converter

The curl Converter turns a curl command into code for JavaScript fetch, axios, Node.js http, Python requests, Go net/http, PHP cURL, HTTPie and wget. Paste a command, for example one copied from the browser's network tab with Copy as cURL, and the converter parses quotes, line continuations, repeated headers, form fields, JSON bodies, basic auth and cookies.

The parsed request appears in an editable builder with method, URL, query parameters, headers, authentication and body. Change anything there and the code updates. It also works the other way round: build a request from scratch and choose curl as the target to get a clean curl command. Options that the converter ignores or cannot map are listed as warnings, so nothing gets lost silently.

Developers use the curl to Python and curl to fetch conversion to move an API call from the terminal or the browser's dev tools into their application, translate examples from API documentation into their language, or share a reproducible request with a colleague. Since parsing and code generation run on the page, it is also safe to paste commands that contain tokens.

Frequently asked questions

Which curl options are supported?

The ones that shape the request: -X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F, --form-string, -u, -A, -e, -b, -G, -I, -L, -k, --compressed, -m, --connect-timeout, --oauth2-bearer, --url-query and --url. Output and logging flags like -s, -v or -o are ignored, and anything else is listed as a warning.

Is my command sent anywhere?

No. Parsing and code generation run entirely in your browser, so tokens and passwords in the command stay on your device.

What happens to files referenced with @?

Files can't be read from your computer here. -F name=@file becomes a file upload in each language with the path filled in; -d @file is kept as text, and a warning tells you to replace it.

Why does the generated code not follow redirects like curl?

curl only follows redirects with -L, while fetch, Python requests, Go and wget follow them by default. With -L set, the PHP and HTTPie code turns following on, and the Node http code marks where to handle the Location header.