What does the converter actually do?
You paste a curl command, a fetch() call, or an axios call, and the tool produces all three forms. It detects the input type from the leading token (curl, fetch( or axios.) and parses headers, method, body, and basic auth. Output blocks are editable and have a copy button. Everything happens in your browser - no requests are made and no data is uploaded.
Which curl flags are recognised?
The common ones used in API examples: -X / --request, -H / --header, -d / --data / --data-raw / --data-binary / --data-urlencode, -u / --user (basic auth), --url, -G / --get, -I / --head, -A / --user-agent, -e / --referer, -b / --cookie. Less common flags are skipped with a best-effort attempt to consume their argument. Multipart -F is not converted because fetch and axios handle file uploads differently.
Can I paste a fetch call I copied from DevTools?
Yes, that is one of the main use cases. Chrome DevTools "Copy as fetch" produces the same shape this tool understands: fetch("url", { method, headers, body }). The body may be a JSON.stringify(...) call, which is parsed correctly. If the call contains JavaScript-only syntax (template literals with substitutions, spread operators), parsing may fall back gracefully or report an error.
Why is the generated body wrapped in JSON.stringify?
When the request body looks like valid JSON, both fetch and axios benefit from a parsed object literal in the source. fetch needs the body as a string, so JSON.stringify wraps the literal. axios sends the literal directly because its data parameter accepts an object and serialises it. Non-JSON bodies are emitted as plain quoted strings so form-encoded or raw payloads still work.
Does it handle authentication headers?
Yes. -H "Authorization: Bearer ..." passes through to both fetch and axios as a header. Curl basic auth via -u user:pass is converted to a base64 Authorization header automatically. Cookies via -b are converted to a Cookie header. Note that fetch in browsers will not send a Cookie header set this way unless credentials are configured - the generated code is meant for Node.js or for understanding the request shape.
Is the parser exact?
It handles the curl shapes you actually see in API documentation: single and double quoted arguments, backslash-newline continuations, multiple -H flags, embedded JSON. It is not a full POSIX shell parser, so commands that rely on environment variables, shell substitution, or piped input will not round-trip. For those, hand-edit the output. Privacy: nothing leaves the page.