cURL Converter — curl to Code

Paste a curl command and instantly turn it into clean JavaScript, Python, or Node.js code.

🔒 Runs entirely in your browser — your command never leaves your device
JavaScript · fetch

About the cURL Converter

curl is the go-to command for testing web requests from a terminal, and it shows up everywhere — in API documentation, browser developer tools, and shared bug reports. But once you want that request inside an app, you have to translate it by hand. This tool does the translation for you: paste a curl command and get working code that makes the exact same request in JavaScript, Python, or Node.js — matching the address, method, headers, body, cookies, and sign-in details.

  • In your browser's Network tab, right-click a request and choose “Copy as cURL”, then paste it here.
  • Keep quotes matched — every opening quote needs a closing one — so the command reads cleanly.
  • Adding data automatically switches the request to POST, exactly like curl does.

How it works

Three steps. No sign-up, no upload, no wait.

1

Paste your command

Drop in a curl command copied from your terminal, browser network tab, or API docs.

2

Pick a language

Switch between JavaScript, Python, and Node.js — the code updates instantly.

3

Copy the code

Grab ready-to-run code that recreates the exact same request.

🔒

Private by design.Everything happens right here in your browser. Your files are never uploaded — we never see them.

Frequently Asked Questions

Which curl options does it understand?
It reads the request address, the method (-X / --request), any number of headers (-H / --header), the request body (-d, --data, --data-raw, --data-binary), basic sign-in details (-u / --user), cookies (-b / --cookie), and follow-redirects (-L / --location). Line breaks with a trailing backslash and quoted values are handled too.
Is my command sent anywhere?
No. The whole conversion happens inside your browser. Your command — including any tokens, passwords, or cookies it contains — never leaves your device and is never uploaded.
Which languages can it produce?
Three, each in its own tab: JavaScript using the built-in fetch, Python using the popular requests library, and Node.js using its native fetch. Just copy the one you need.
Does adding a body change the method?
Yes — just like curl. If your command includes data but no explicit method, the request is treated as a POST. You can still force any method by keeping -X in the command.
Why does my generated code look slightly different from the command?
The tools aim to reproduce the same request, not the exact text. For example, sign-in details from -u become an Authorization header, and repeated headers are combined. The resulting request behaves the same way.
It says it can't read my command — what now?
Make sure the text starts with the word curl and that every quote has a matching partner. Very unusual or rarely-used options may be skipped. Try trimming the command down to the address, headers, and body.