cURL Converter

Paste a curl command and copy the same request in another language. The command is read as text on this page. It is never run, and nothing is sent.

How it works

The page reads your command the way bash would: it splits it into words, follows the quotes and backslashes, and joins lines that end in a backslash. It also reads the

...' strings that browsers write in "Copy as cURL".

It then reads the curl options that describe the request: the method, the URL, the headers, the body, the user name and password, cookies and the user agent. From those it builds one request and writes it as fetch, Axios, Python, Go, PHP, HTTPie or a tidy cURL command.

Some options cannot be carried into code, such as -o, which saves the reply to a file. The page lists each one it left out and says why, so you never lose part of a request without knowing.

All of this happens in your browser. The command is not run, the URL is not contacted, and tokens in the command stay on your device.

How to use it

  1. 1 Copy a request as cURL. In Chrome, Edge or Firefox, open the developer tools, right-click a request in the Network tab and choose Copy as cURL (bash).
  2. 2 Paste it into the box. The request is read as you type.
  3. 3 Read the notes under the box, if there are any. They say which parts of the command were left out.
  4. 4 Pick a language and copy the code, or download it as a file.

Good to know

Browser support

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

From "Copy as cURL" to working code: what the converter reads

Take a request copied from Chrome's Network tab. It looks like this: curl 'https://api.example.com/items?page=2' -H 'accept: application/json' -H 'authorization: Bearer abc123' -H 'content-type: application/json' --data-raw '{"name":"café"}' --compressed. The converter splits it into words, the way bash would. The single quotes keep each value together, so the JSON body with its spaces and double quotes is one word. Then it reads each option in turn: three headers, one body, and --compressed, which only tells curl to accept a compressed reply and so does not change the request.

The command has no -X, yet the converter says POST. That is curl's own rule. A command with a body is sent as POST unless -X says otherwise, and a command with -I or --head is sent as HEAD. Code in other languages has no such rule, so the converter writes the method down. The fetch version reads method: 'POST', followed by the three headers, in the order and with the spelling Chrome used, and body: '{"name":"café"}'. The body is copied as the same string. It is not parsed and rebuilt, so the bytes are the same bytes.

Small commands hide more of curl's defaults. curl -d 'name=Ann' https://api.example.com/items has no headers at all, but curl sends Content-Type: application/x-www-form-urlencoded with it. The converter adds that header, so the Python version sends the same thing. This explains a common surprise: a hand-written curl -d '{"name":"Ann"}' sends JSON labelled as a form, and many APIs reply 400 or 415. Add -H 'Content-Type: application/json', or use --json, which sets both Content-Type and Accept to application/json. With -G the rule changes again: curl -G -d q=café https://api.example.com/search is a GET, and the data goes on the URL as ?q=café.

Credentials keep their own form where a language has one. curl -u alice:pa:ss splits at the first colon only, so the user is alice and the password is pa:ss. The Python version uses auth=('alice', 'pa:ss'), Go uses SetBasicAuth, and fetch, which has no option for it, gets the header Authorization: Basic YWxpY2U6cGE6c3M=. That is the Base64 of alice:pa:ss, and Base64 is not encryption. Anyone who sees the code can decode it back to the password.

The converter is honest about what it leaves out. -o, -m, --retry, a proxy, client certificates and other options change how curl runs, not what it sends; each one gets a note under the box. Bodies read from files (-d @data.json), cookies read from a file (-b cookies.txt) and multipart forms (-F) cannot be carried over, because the files are not here, and each gets a note too. A command copied for Windows cmd is refused with a hint to copy the bash version. Shell variables such as $TOKEN are left as text, because the page reads the command and never runs it. If the converter does not know an option, it says so by name rather than guessing.

Frequently asked questions

Does this page run my curl command?

No. It reads the command as text. Nothing is executed, no request is made to the URL, and the command is not sent to YappyKit. Shell variables such as $TOKEN and command substitutions are not expanded either; they stay in the output as plain text.

Why is a header from my browser missing in the code?

It is not missing from the conversion: every -H header is copied over. But if you run fetch code in a web page, the browser itself refuses to set some headers, such as Cookie, Host, Origin and Referer. Code that runs on a server, such as Python or Go, sends them as written.

Can it convert -F multipart forms and file uploads?

No. A multipart form can carry files from your computer, and each language builds one differently. The page warns you and leaves the form out, rather than writing code that looks right and sends something else.

What happens to -d @file.json?

The @ tells curl to read the body from a file on your computer, and that file is not on this page. The converter leaves the body out and says so. Paste the contents of the file into the command in place of @file.json and convert it again.

Is it safe to paste a command with a real token in it?

The page does not send it anywhere, so the token stays in your browser tab. Still, "Copy as cURL" includes every cookie and Authorization header the browser sent. Treat the command and the code made from it like a password, and do not paste them into a chat or a bug report.

Related tools

Request Code Generator Fill in one HTTP request and get it as cURL, fetch, Axios, HTTPie, Python, Go or PHP. HTTP Client Send GET, POST, PUT, PATCH and DELETE requests straight from your browser. URL Encode and Decode Percent-encode text for a URL, or turn %20 and friends back into text.

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.