curl → fetch/axios
Common flags only (-X, -H, -d/--data*, -u, --url) — not the full curl flag surface. One direction only: curl → code. Cmd/Ctrl+Enter saves this command to history.
Only the "raw" body mode is read — form-data/urlencoded/binary request bodies aren't converted. Folders are flattened.
Advertisement
Paste a curl command, get equivalent fetch or axios JavaScript. Covers the common flags — -X/--request, -H/--header, -d/--data*, -u/--user — plus importing a full Postman collection export. This only converts curl to JS, not the reverse: unlike curl's fixed flag syntax, fetch/axios code has no single canonical form to parse back into curl.
Frequently asked questions
- Can it convert fetch or axios code back into a curl command?
- No, one direction only: curl to fetch/axios. The reverse has no well-defined grammar to parse against — fetch and axios calls can be written in unlimited equivalent ways (destructured options, spread variables, wrapper functions), so there's no reliable way to convert arbitrary JS back to a single curl command.
- Does it support -u for basic auth?
- Yes — -u user:pass is converted into an Authorization: Basic header with the credentials Base64-encoded, matching what curl itself does under the hood.
- Can I import a whole Postman collection instead of one curl command?
- Yes. It reads a Postman v2.x collection export and converts every request inside it (including nested folders). Only the "raw" body mode is supported — form-data, url-encoded, and binary bodies aren't representable as a single fetch/axios body string.
- Is my curl command uploaded anywhere?
- No. Conversion happens locally in your browser tab — nothing is sent to a server.
Read the full guide for this tool →
Advertisement