cURL to Fetch Converter Developer
Paste a curl command and get the equivalent JavaScript fetch call.
cURL to Fetch Converter is a free online tool that paste a curl command and get the equivalent JavaScript fetch call. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.
- Price
- Free — no account, no quota, no watermark
- Category
- Developer
- Where it runs
- In your browser, on your device
- Files uploaded
- None
- Technology
- plain JavaScript
- Settings
- 2
- Works offline
- Yes, after the first visit
About cURL to Fetch Converter
Copy as cURL is the fastest way to capture a request from a browser’s network panel, and the slowest to turn back into code by hand. This parses the command properly — a real shell tokenizer that handles single quotes, double quotes, backslash escapes and line continuations — rather than splitting on spaces and hoping. Flags with no fetch equivalent are reported instead of silently dropped, and a JSON body is re-emitted as an object literal inside `JSON.stringify` rather than left as an unreadable escaped string.
How to use it
- Paste the text you want to run through curl to fetch converter.
- Set output and explain dropped flags.
The 2 settings
| Setting | What it does | Default |
|---|---|---|
| Output | Choose from 3: fetch (async/await), fetch (.then), axios. | fetch (async/await) |
| Explain dropped flags | On or off. On by default. | On |
Under the hood
| Runs on | plain JavaScript — runs the whole thing |
| Controls | Output, Explain dropped flags |
Questions
What happens to flags fetch has no equivalent for?
They are listed as comments above the output rather than dropped in silence. `-k` (skip certificate checks) genuinely has no browser equivalent — certificate validation belongs to the browser, not your code. `-L` is already fetch’s default. `-s`, `-v` and `--compressed` describe curl’s own behavior and have nothing to translate to.
Why did -u become an Authorization header?
Because that is what curl does — `-u user:pass` is shorthand for a Basic authorization header, so the conversion makes the implicit step explicit. Do note that hard-coding credentials into client-side JavaScript puts them in front of everyone who loads the page.
Does it handle file uploads?
`-F` becomes a `FormData` with the same fields. A `-F` value referencing a local file (`@photo.jpg`) cannot be reproduced — a browser can only read a file the user picked — so you get the field and will need to supply the File yourself.