cURL to Code

cURL into fetch, axios, or requests.

Runs locally in your browser Report an issue
Generated code

Paste a cURL command to convert it

Drop in a cURL command — or “Copy as cURL” from DevTools — and get fetch, axios, or Python requests code. Everything is parsed in your browser; tokens and cookies never leave the page.

Runs entirely in your browser

Convert cURL to code

Paste a cURL command — including the long “Copy as cURL” you get from the Chrome DevTools Network tab — and get equivalent code in JavaScript fetch, axios, or Python requests. The converter parses the method, URL, headers, cookies, request body, and basic auth, infers a POST when there is a body, and serialises JSON bodies with the idiomatic call for each library. Copy the result into your project. Parsing happens entirely in your browser, so a command containing tokens or cookies is never uploaded.

Common questions

Does it work with Chrome DevTools “Copy as cURL”?

Yes. Right-click a request in the Network tab, choose Copy → Copy as cURL, and paste it here. The multi-line form with backslash continuations and many -H headers is parsed directly.

Which outputs are supported?

JavaScript fetch() (async/await), axios, and Python requests. Each is generated with the right idiom for a JSON body, headers, and HTTP method.

How are JSON bodies handled?

When the Content-Type is JSON and the body parses as JSON, fetch uses JSON.stringify, axios passes it as the data object, and Python passes it as json=. Non-JSON bodies are sent as a raw string (or form-encoded).

What about authentication?

A -u user:pass basic auth flag becomes a btoa Authorization header for fetch, an auth object for axios, and an auth=() tuple for Python. Token headers you pass with -H are copied across verbatim.

Is my cURL command uploaded anywhere?

No. Everything is parsed and generated in your browser. A command that includes API keys, bearer tokens, or session cookies never leaves your device.