cURL → fetch converter
Paste a curl command — including your browser's Copy as cURL (bash) — and get ready-to-paste JavaScript fetch code. It all happens in your browser: nothing is uploaded.
Converts automatically as you type — nothing leaves your browser.
Your fetch code will appear here.
What it does
- Emits a fetch(url, { … }) call ready to paste
- Understands methods (-X), headers (-H), cookies, user-agent
- JSON bodies via JSON.stringify, others as template literals
- Basic auth (-u) → an Authorization header
- Parses your browser's Copy as cURL (bash) output
Keep the request, not just the code
Code goes stale the moment the endpoint changes. Keep the request as a .http file you can re-run and diff — convert cURL → .http instead, or open it in Karve.
Need C# instead? cURL → C#Common questions
How do I convert a cURL command to JavaScript fetch?
Paste the command above — it's parsed in your browser into ready-to-paste JavaScript that calls the fetch API, with method, headers, and body filled in.
How are request bodies handled?
JSON bodies use JSON.stringify; others use a template literal. Bodies on GET/HEAD are skipped with a note, matching how fetch behaves.
Does it handle headers and Basic auth?
Yes — -H headers and -u Basic auth carry into the fetch options, including a browser "Copy as cURL".
Is my cURL command uploaded anywhere?
No. Conversion runs entirely in your browser — nothing you paste, including tokens, leaves your machine.
Keep the request as a .http file.
Generate fetch code when you need it — but keep, re-run, and debug the request in Karve, the native Windows workspace for .http files.
15-day free trial · No account · No subscription · No metered requests
25% off until Sep 1