cURL to JavaScript Converter
Convert cURL commands into JavaScript fetch or Axios snippets without leaving the browser.
Input
Paste a raw cURL command, then prefill examples or clear the input to try another request shape.
How to copy requests as cURL from your browser
Chrome / Edge: Open DevTools, go to Network, right-click the request, then choose Copy and Copy as cURL.
Firefox: Open DevTools, go to Network, right-click the request, then choose Copy Value and Copy as cURL.
Safari: Open Web Inspector, switch to Network, right-click the request, then choose Copy as cURL.
Output
Fetch output. Copy the converted snippet once the request looks right.
Converted Fetch code appears here.
Paste a cURL command or load one of the examples to generate a ready-to-copy snippet.
Converting command...
Generating Fetch code from your cURL request.
The command could not be converted.
- Make sure the command starts with curl.
- Keep quoted JSON, headers, and URLs intact when pasting.
- Try one of the built-in examples to compare the expected input format.
Need high-quality proxies? Try anyIP for $2/GB.
View pricingCommon cURL Flags in JavaScript
Compare common cURL patterns against JavaScript equivalents, including fetch and Axios variants.
| Use Case | cURL Command | Fetch Equivalent |
|---|---|---|
| Simple GET | curl https://api.example.com/users |
Generating example...
|
| JSON POST | curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name":"Ada Lovelace","role":"admin"}' |
Generating example...
|
| Bearer token | curl https://api.example.com/private \ -H "Authorization: Bearer YOUR_TOKEN" |
Generating example...
|
| Multipart upload | curl -X POST https://api.example.com/upload \ -F "file=@avatar.png" \ -F "title=Profile photo" |
Generating example...
|
| Proxy usage | curl https://api.example.com/data \ --proxy http://user:pass@127.0.0.1:8080 |
Generating example...
|
Other cURL Converters
Jump between language-specific converter pages while keeping the same cURL workflow.
Convert cURL commands into Python requests snippets using the shared anyIP tool workflow.
Convert cURL commands into PHP snippets using the shared anyIP tool workflow.
Convert cURL commands into Go net/http snippets using the shared anyIP tool workflow.
Convert cURL commands into Ruby snippets using the shared anyIP tool workflow.