Converts a curl command to fetch or axios code.
cURL to Code converts a curl command into ready-to-use JavaScript HTTP code, either a fetch call or an axios request. It parses the URL, request method, headers (-H), and request body (-d, --data, --data-raw, --data-binary, --data-ascii) and emits a clean code snippet you can paste straight into your project. It's handy when you've copied a curl command from API docs, a browser's network tab, or Postman and want the equivalent JavaScript.
No. The conversion runs entirely in your browser using local JavaScript. Nothing you paste is uploaded or transmitted anywhere.
It recognizes the URL, -X/--request for the method, -H/--header for headers, and -d/--data, --data-raw, --data-binary, and --data-ascii for the request body. Other flags are ignored rather than translated.
If you pass -X or --request, that method is used. Otherwise it defaults to GET, or to POST when the command includes a request body.
You can choose between a fetch call or an axios request using the Output option. Both include the method, any headers, and the body when present.
Yes. The parser respects single and double quotes and handles backslash line continuations, so multi-line curl commands copied from docs are tokenized correctly.