Convert cURL to JavaScript Fetch
Paste a cURL command and get equivalent JavaScript fetch() code with headers and body.
How to use
- Paste your cURL command in the input box.
- JavaScript fetch code appears automatically.
- Click Copy to copy the generated code.
Frequently asked questions
What cURL flags are supported?
Common flags: -X method, -H headers, -d/--data body, --json, and URL. Complex flags may need manual adjustment.
Does this send the request?
No. This only converts the cURL command to fetch() syntax. Run the code in your app to execute.
Is async/await included?
Output uses fetch() with .then() by default. Easy to wrap in async/await in your code.
Is my data sent to a server?
No. Conversion happens entirely in your browser.
Last updated
Powered by maratool