Turn any cURL command into fetch, axios, or Python requests code. Parsed locally — safe for real tokens.
Paste a cURL command to translate it into fetch, axios, or Python code
cURL parsing and code generation run entirely in your browser. Your command (including any tokens!) is never uploaded.
A shell tokenizer first splits the command, honoring single quotes (no escapes inside), double quotes (\\" \\$ escapes), and backslash continuations. Then a flag pass maps each option: -H becomes a header pair, repeated -d flags join with & exactly as cURL sends them, -F flags signal multipart FormData, -u becomes HTTP Basic auth, and the method defaults to POST when a body exists, GET otherwise. Output is copy-paste runnable — but review it: secrets in the command end up in the code.
Quote handling follows real shell semantics: single quotes are literal, double quotes allow escapes, backslash continues lines.
Kai copies a working cURL from a Stripe-style dashboard and needs it inside his Next.js route handler.
Convert cURL to JavaScript Fetch, Axios, or Python requests online free. Everything runs locally; nothing is uploaded.
FreeToolHub cURL to Fetch Converter is a free browser-based tool — convert cURL to JavaScript Fetch, Axios, or Python requests online free. No signup, no upload; everything runs locally in your browser.
Convert cURL to JavaScript Fetch, Axios, or Python requests online free. Shlex-safe parsing, live preview.
API documentation speaks cURL; your application speaks Fetch, Axios, or Python requests. Retyping a complex command - headers, auth, multipart bodies - is where transcription bugs live. Pasting the command and getting correct, idiomatic code in your actual HTTP client removes the entire class of copy mistakes.
The tokenizer mirrors Unix shell rules: single-quoted strings are literal, double-quoted strings honor backslash escapes, and trailing backslashes join continued lines. The parsed request - method, URL, headers, body, auth - previews live before generation, and the whole pipeline runs in your browser so credentialed commands never leave the page.
The generated fetch code is a starting point, and a quick review pass makes it production-ready. First, headers: cURL's single quotes vanish in JavaScript, so strings containing single quotes need escaping — the generator emits double-quoted strings for those, worth double-checking when the body contains both quote types. Second, error handling: fetch resolves successfully on HTTP 404 and 500, unlike axios, so a real implementation needs a res.ok check the one-liner does not include. Third, credentials: cURL's -b cookie flag becomes a Cookie header, but in browsers the cookie jar is managed by the credential option instead — same-origin requests usually want credentials: 'include' rather than a hand-built header. The axios and Python translations carry the same shape: correct as a skeleton, review before shipping.
The parser reads -X (method), -H (repeated headers), -d (multiple bodies are joined with an ampersand), -F (multipart with @file detection), -u (basic auth), --url, -L (follow redirects), -k (insecure), -I (HEAD), -A (user agent), -e (referer), and -b (cookies). Unsupported flags are reported instead of silently dropped.
Commands are tokenized with a shlex-style parser: single quotes protect everything inside, double quotes allow backslash escapes, and backslash line continuations join multi-line commands. This mirrors how a Unix shell would parse the same command.
No. Parsing and code generation run entirely in your browser - a cURL command containing an Authorization header never leaves the page. This is exactly why the tool exists: pasting credentialed cURL into random websites is a real leak vector.
cURL expresses a request as command-line flags while fetch expresses it as an options object — the generator reorders rather than translates word for word. Flags like -X merge into method, -H into headers, -d into body, and -u into an Authorization header. The semantic request is identical even when the layout is not.
Yes for the cURL -F form syntax: the generator maps each -F field into FormData and drops the manual Content-Type header, because the browser must set the multipart boundary itself. Binary file references like @photo.jpg become a note in the output — attach a real File or Blob from your code at that field.
What do you call a nosy pepper?
No signups, no data sold. Every tool is free to use — the free tier allows 5 downloads or saves per day, and the optional Pro plan ($7/mo, $59/yr) adds unlimited downloads, batch processing, white-label exports and an ad-free experience.
☕Support me on Ko-fi— support the free tier100% of proceeds go towards hosting & building more free tools.