cURL to Fetch Converter
Convert cURL commands to JavaScript fetch() code instantly in your browser. Supports headers, methods, body, and auth. No data leaves your device.
Related Tools
JWT Decoder
Decode JWT tokens instantly. Inspect header and payload client-side — your token never leaves the browser.
Unix Timestamp
Convert Unix timestamps to UTC, local time, and ISO 8601 instantly. Auto-detects seconds vs milliseconds.
Base Converter
Convert numbers between decimal, hex, binary, and octal instantly. Free and runs in your browser.
Advertisement
How to Use
- Copy a cURL command from your terminal, browser DevTools, or API documentation.
- Paste it into the input panel (with or without the
curlprefix). - The equivalent JavaScript
fetch()code appears instantly on the right. - Click Copy Output to copy it to your clipboard.
- Paste directly into your JavaScript or TypeScript project.
Supported cURL Flags
-X METHOD— HTTP method (GET, POST, PUT, DELETE, PATCH)-H 'Header: Value'— Request headers-d 'data'/--data— Request body--data-urlencode— URL-encoded form data-u user:pass— Basic authentication--compressed— Mapped to Accept-Encoding header-L— Follow redirects (noted in output)
Example
curl -X POST https://api.example.com/data \
-H 'Content-Type: application/json' \
-d '{"key":"value"}'