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.
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.
Frequently asked questions
Which cURL flags does the converter actually understand?
Why did the method come out as POST when I never wrote -X POST?
Does the generated code run exactly as it comes out?
Related Tools
cURL → PowerShell / wget Converter
Converts cURL commands into PowerShell Invoke-RestMethod, Invoke-WebRequest or wget, preserving method, headers, body, auth and redirects.
JSONP to JSON Converter
Strips the callback wrapper of a JSONP response leaving only the JSON contained inside the parentheses.
Tire Pressure PSI to BAR Converter
Convert tire pressure between PSI and BAR instantly. Inflate your car or motorcycle tires with the right unit for safety and fuel economy.
YAML to TOML Converter
Convert config files from YAML to TOML right in your browser, preserving strings, numbers and booleans. Handy for migrating configs between formats.
Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Instant bidirectional conversion.
Feet/Inches ⇄ Meters
Convert between feet/inches (5'10") and meters (1.78 m). Supports combined input and configurable rounding. Everything in your browser.