About the cURL Converter
Developers copy cURL from browser DevTools, then need the same call in application code. This converter parses the command and prints idiomatic snippets for six common stacks.
Browser developer tools and many API docs still speak cURL. Application code, however, speaks fetch, Axios, requests, or a net/http client. Rewriting that command by hand is where flags get dropped and Content-Type goes missing. This converter reads a cURL command in the page and prints equivalent snippets for JavaScript fetch, Axios, Python requests, PHP’s cURL extension, Go’s net/http, and Node fetch.
The parser understands the flags you actually copy from Chrome: -X or --request, -H, --data and --data-raw, --data-urlencode, -u, --url, -G, -I and --compressed. Quoted strings and line continuations with a backslash are accepted. The generated code is a starting point: you should still move secrets into environment variables and add error handling, but the method, URL, headers and body are already in place.
Nothing is executed. If you want to fire the request from a browser tab, paste the same command into the API Tester’s import box. Keeping conversion and execution separate means this page can stay fully offline after it has loaded.
How to use the cURL Converter
- 1Paste a cURL command copied from DevTools or a README.
- 2Choose fetch, Axios, Python, PHP, Go or Node.
- 3Copy the snippet into your project and review secrets before committing.
Key features
- Parses everyday cURL flags, quotes and line breaks.
- Six targets: fetch, Axios, Python requests, PHP cURL, Go net/http, Node fetch.
- Shows the detected method and URL as you edit.
- Copy buttons on the generated snippet.
- All parsing happens in the browser; the command is not sent to a server.
Practical uses
- Translating a DevTools “Copy as cURL” into front-end or backend code.
- Moving an example from an API README into a test helper.
- Comparing how the same call looks in Python versus Go.
Tips and common mistakes
- Review Authorization headers before you commit the snippet.
- If a flag is ignored, check the list of supported options and add that part by hand.
- Python output prefers json= when Content-Type is application/json and the body parses.
Limitations
- Rare flags such as --cert, --http2 or cookie jars are not modelled.
- Shell-specific expansions like $TOKEN are copied through as literal text.
Privacy
The command you paste never leaves this tab. That matters when it contains tokens or internal hosts.
Frequently asked questions
Which flags are supported?
Common ones: -X, -H, -d / --data-raw, -u, --url, -G, -I and --compressed. Exotic flags are ignored.
Is the output always runnable?
It is a starting point. You may still need cookies, mTLS or environment variables.
Does it send the request?
No. It only generates code. Use the API Tester to send a call from the browser.
Can it convert the other way?
The API Tester can build a cURL command from a filled request. This page focuses on cURL as the input.
Why does Python say True and None?
Those are Python literals. JSON true and null are converted so the snippet runs in requests.