1001Ferramentas
๐Ÿ”Converters

cURL to fetch()

Paste a cURL command and generate the JavaScript fetch() equivalent. Supports -X, -H, -d, --data-raw, querystring and cookies. Everything in your browser.

Related Tools

Convert cURL to JavaScript fetch()

API documentation almost always gives the examples in cURL, except on the front end what you want is the fetch() equivalent. Rewriting it by hand, translating header by header and every parameter, is tedious and a single slip away from a mistake. This converter does that translation on its own.

Paste the cURL command and get the matching fetch(). It handles the most common elements: the method (-X), the headers (-H), the request body (-d, --data-raw), the query string and cookies. Within seconds the code is ready to drop into your JavaScript project.

The conversion runs entirely in the browser, so the command never leaves your device. You can convert requests carrying tokens or sensitive data without worrying.