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.
- Copy the result, or use Send to… to open it in another tool. The Request headers panel lists the headers on their own, ready to copy or send to the headers inspector.
- Read the Warnings and Notes under the output: they list options that were ignored, local files that became placeholders and things the target can’t reproduce.
How it works
A cURL command is split into arguments with POSIX shell quoting rules: single and double quotes,