← Tools

cURL to Code

Paste a curl command and get code that's ready to run.

Private: your files never leave your device.

Works with commands copied from browser developer tools (Copy as cURL, bash or cmd) and API docs: headers, every kind of data, JSON, forms and file uploads, sign-in and cookies. Nothing you paste is uploaded or run.

How it works

  1. Choose your files.
  2. Adjust the settings if you like.
  3. Download the result, or send it to another device with BroAllDone.

Frequently asked questions

How do I convert a curl command to code?

Paste the command, choose a language and press Convert. The code has the same method, URL, headers, body and sign-in.

Which languages are supported?

JavaScript (fetch), Node.js (fetch or axios), Python (requests), PHP, Go, Java, C#, Ruby, Rust and PowerShell.

Can I paste Copy as cURL from my browser?

Yes. Both the bash and the Windows (cmd) versions from Chrome, Edge and Firefox developer tools work, including line breaks and quotes.

Are JSON bodies, forms and file uploads handled?

Yes: -d, --data-raw, --data-binary, --data-urlencode, --json and -F, with files, as well as -u, -b, -G, -L and -k.

What if an option can't be converted?

It's listed under the result, for example a proxy or a client certificate, so nothing is dropped without telling you.

Is my command sent anywhere?

No. It's converted in your browser and never run, so tokens and passwords stay on your device.

More free tools