cURL ↔ Fetch
Convert cURL commands to fetch and back
Turn a cURL command into JavaScript fetch, Node, axios or Python requests code, and convert fetch calls back into cURL.
- cURL
- fetch
- HTTP
- axios
How to use cURL ↔ Fetch
- Choose a Direction: cURL → code or fetch → cURL.
- Paste a cURL command (for example from DevTools → Network → Copy as cURL, bash or cmd) or a
fetch()call into the input. You can also drop a file on the box, use Open file, or click Try an example. - For cURL → code, pick a Language: JavaScript fetch, Node.js fetch, axios or Python requests.
- Read the Warnings and Notes under the output (ignored options, local files that became placeholders, things the target can’t reproduce), then copy the result or use Send to…. The Request headers panel lists the headers on their own.
- To build a request from scratch, switch Mode to Request builder (or press Edit in builder on a converted command): set the method and URL, then use the Query, Headers, Auth, Body and Settings tabs. The code updates as you type, and Open in converter sends the cURL back.
How it works
A cURL command is split into arguments with POSIX shell quoting rules: single and double quotes,