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
PDF to Images
Convert PDF pages to individual PNG images. Everything in your browser via pdf.js.
Pixel Art Converter
Convert an image to pixel art by reducing resolution and color palette. Stylized retro output.
Currency Converter
Convert between major currencies (USD, EUR, BRL, GBP, JPY, ARS) using live rates from open.er-api.com.
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.