DevGrill

curl Converter

Turn curl commands into fetch, Python, Go, C# and 6 more.

Runs in your browser

0 chars
0 chars

Tip: in your browser's DevTools, right-click a request in the Network tab and choose Copy → Copy as cURL, then paste it here.

From curl to code in one paste

API docs show requests as curl commands, and browser DevTools can copy any request as one. This tool turns that command into the same request in your language: JavaScript (fetch or axios), Python requests, Go, Java, C#, PHP (Guzzle), Ruby, Rust (reqwest) or PowerShell.

Bodies are sent exactly as curl would send them, headers keep their order, and JSON bodies become native objects where the language can hold them without rounding. curl commands often contain real API keys, so it all happens in your browser, and a warning appears when the command includes credentials.

How to use the curl Converter

  1. Paste a curl command. Multi-line commands with \ are fine, as is Chrome's Copy as cURL output for bash or Windows.

  2. Pick your language. The code updates instantly, and your choice is remembered next time.

  3. Check what we understood. The method, URL, headers and body are listed under the code, along with anything curl did that the code can't do.

  4. Copy the code. Switch on Hide secrets first if you're sharing it, to swap tokens and passwords for placeholders.

Tips

  • In Chrome, Edge or Firefox DevTools, right-click a request in the Network tab and choose Copy → Copy as cURL to grab exactly what the browser sent.
  • -d sends a form by default. Add -H 'Content-Type: application/json' or use --json and the converter switches to a JSON body.
  • Options that only affect curl's own output, like -s, -v or -o, are ignored; anything that changes the request is converted or listed as a warning.

Frequently asked questions

Is it safe to paste a command with my API key?

Yes. The command is read and converted in your browser and never sent anywhere. The page has no share link, so it can't end up in a URL either. Turn on Hide secrets before you share the generated code.

Which curl options are supported?

The ones that shape the request: -X, -H, -d and its variants (--data-raw, --data-binary, --data-urlencode, --json), -F for forms and files, -u, -b, -A, -e, -G, -I, -L and -k. Anything else is ignored or listed as a warning.

Why is my JSON sent as a string in JavaScript?

When the body contains integers bigger than JavaScript can store exactly, turning it into an object would round them. The converter sends the original JSON text instead, so the request stays identical.

Does it work with Windows curl commands?

Yes. Chrome's Copy as cURL (cmd) format, with its ^ escapes, is understood as well as the bash format.

Related tools