cURL to Code Converter

Free

Convert cURL commands to JavaScript, Python, and PHP — entirely in your browser.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

cURL command
JavaScript (fetch)
Paste a curl command above to see generated code here.
Nothing you paste here is stored or transmitted — parsing and code generation happen entirely in your browser. Curl commands copied from DevTools often contain live auth tokens or session cookies, so this matters more here than in most tools.

How it works

What does this tool actually do?

It takes a curl command — the kind you get from a browser's DevTools via "Copy as cURL" on a network request, or one written by hand in API documentation — and translates it into equivalent code in another language or HTTP library: the same URL, method, headers, and body, expressed as a fetch() call, an axios request, a Python requests call, or PHP's cURL functions.

Which curl flags does it actually support?

The URL (bare or via --url), -X/--request for the HTTP method, -H/--header (repeatable), -d/--data/--data-raw/--data-binary for the request body, -u/--user for basic auth, -b/--cookie, and --compressed. curl itself has several hundred flags covering everything from TLS pinning to FTP — this tool doesn't attempt to support all of curl, only this common subset. Anything else in your command is called out as an unsupported flag rather than silently ignored, so you always know if something was dropped.

What happens if my command has a flag this tool doesn't support?

It's listed explicitly in a warning above the generated code, naming exactly which flag(s) weren't understood, instead of quietly producing code that's missing something you didn't know was skipped.

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

Yes, and this matters more here than in most tools: a curl command copied from DevTools very often contains a live session cookie, bearer token, or API key. Parsing and code generation both happen entirely in your browser — nothing you paste is uploaded, logged, or sent anywhere. That said, treat any token you've pasted anywhere as something to rotate if you're not sure where it's been.

Related tools