From Chrome cURL to application code
The fastest way to reproduce a request is still Chrome or Firefox DevTools: Network panel, right-click, Copy as cURL. That string is ugly on purpose. It has line-continuation backslashes, quoted headers, and often a session cookie you should not commit.
This converter turns that command into fetch, Axios, Python requests, or Go net/http. Tokenizing and code generation run in the page. The command is not uploaded, and the page does not execute the request.
If you only need to inspect or encode the URL itself, use the URL Encoder/Decoder.
What the converter reads from a cURL command
A naive split(' ') breaks on quoted JSON and on \ newlines. This tool tokenizes the command first, then reads the flags people actually copy from DevTools:
- URL as the first non-flag argument, or
--url -X/--requestfor the method. A body with no method becomesPOST, matching curl-H/--header, plus-A,-e, and-basUser-Agent,Referer, andCookie-d,--data,--data-raw,--data-binary,--data-urlencode-u/--useras HTTP basic auth-Gmoves data onto the query string-IbecomesHEAD
Flags that do not change the generated client (--compressed, -k, -s, -L) are ignored instead of becoming fake options.
fetch vs Axios vs Python vs Go
fetch is the default browser and modern Node client. JSON bodies are passed through JSON.stringify so the object stays readable.
Axios uses method, url, headers, and data. Basic auth from -u becomes the auth field.
Python emits requests.get / requests.post and friends. JSON bodies become a payload dict and json=payload.
Go builds http.NewRequest with req.Header.Set and SetBasicAuth when -u is present.
The output is meant to be pasted into a file, not to be a full SDK.
Secrets in copied cURL
Copy as cURL includes whatever the browser sent. That is often Authorization: Bearer ... or a long Cookie header. The tool flags those names and, with Redact secrets on (the default), replaces values with YOUR_TOKEN, YOUR_COOKIE, or YOUR_USERNAME / YOUR_PASSWORD.
Turn redaction off only when you are converting a request that already uses dummy credentials. Do not screenshot the output with a live session cookie.
Common use cases
- Rebuild a failing API call from DevTools inside a unit test
- Hand a backend engineer a Python snippet instead of a 40-line curl
- Turn a POST with
--data-rawJSON into readablefetchfor a frontend ticket - Strip cookies before pasting a request into Slack or a PR
Pretty-print the JSON body first in the JSON Formatter & Validator if you need to inspect it on its own. Decode a bearer token in the JWT Decoder.
How to use
- In DevTools, copy the request as cURL (bash).
- Paste it into cURL command, or use Load GET Sample / Load POST Sample.
- Pick fetch, Axios, Python, or Go.
- Leave Redact secrets on unless the command is already safe to share.
- Copy Code or Download the file.
Privacy
Parsing and code generation stay in the browser. There is no convert API and no “Run request” button, so a pasted token is not forwarded to the target host from this page. Clear the textarea or close the tab to drop the command.
Frequently Asked Questions
Why does my pasted cURL fail to parse?
The usual causes are a truncated command, an unmatched quote, or a PowerShell snippet that is not POSIX cURL. Copy as cURL (bash) from Chrome or Firefox, and keep the backslash line breaks.
Does this run the request?
No. The tool only parses the command and generates code. It does not call the URL, so a pasted token cannot leak to a third-party host from this page.
Which languages are supported?
JavaScript fetch, Axios, Python requests, and Go net/http. Those cover the clients people paste into most app and script repos.
What happens to Authorization headers?
They are detected and listed in a warning. With Redact secrets on, bearer tokens, cookies, and -u credentials become placeholders in the generated code.
Can I convert a POST with a JSON body?
Yes. --data-raw and -d bodies that are JSON are pretty-printed. fetch uses JSON.stringify, Axios uses data, and Python uses the json= argument.