cURL to Code
Paste any curl command and get equivalent, idiomatic code for JavaScript fetch, axios, Node.js, Python requests, Go, PHP, Ruby, Java, C#, Rust, PowerShell or a raw HTTP/1.1 request. It understands -X, -H, -d, --json, -F, -u, -b, -G, -I and more, and everything is parsed in your browser.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What it does
Paste a curl command and it is parsed into a small request model, then rendered as idiomatic code for JavaScript fetch, axios, Node https, Python requests, Go, PHP, Ruby, Java, C#, Rust, PowerShell, or a raw HTTP/1.1 request. The output is a code block whose language matches the chosen target, plus a request.txt or request.http filename and stats for the method, target, header count and body kind.
When to use it
Use it when a docs page or a browser network tab shows a curl one-liner but you work in another language. Reproduce that exact request in your stack instead of hand-translating each flag, header and data body.
The target option
The single option, target, picks the generator. Each language has its own escaping and library calls: fetch builds on Request and Headers, Python uses requests, Go uses net/http, and http emits a literal request block you can replay. Changing the target only changes how the same parsed request is rendered.
Edge cases and limits
File uploads from -F only carry a local path such as @photo.png, so the generated multipart code marks where you must supply the File or Blob; the field names stay correct. Transport-specific flags like custom certificates become notes rather than being dropped, while unrecognised flags are ignored. Commands over 200,000 characters are rejected.
Privacy
Parsing and code generation run entirely in this tab, so nothing is uploaded and the tool works offline. Since curl commands often hold tokens and cookies, trim or rotate any secrets before sharing the generated snippet.
Questions
Which curl flags are understood?
The request-shaping flags: -X/--request, -H/--header, -d/--data*, --json, -F/--form, -u/--user, -b/--cookie, -A/--user-agent, -e/--referer, -G/--get, -I/--head, -T/--upload-file, -L/--location, -k/--insecure, --compressed, -m/--max-time and -x/--proxy. Other flags are ignored, and genuinely transport-specific ones (custom certificates, --resolve) are reported as notes rather than silently dropped.
Why do file uploads show a TODO comment?
A curl command only contains a path such as @photo.png. The browser cannot read that local file from a pasted command, so the generated code marks where the File/Blob or stream should be supplied — the multipart structure and field names are still correct.
Is my command sent anywhere?
No. Parsing and code generation run entirely in your browser tab. Commands often contain tokens and cookies, so trim or rotate any secrets before sharing generated snippets.
Related tools
See categoryHTTP Status Code Reference
Look up HTTP status codes — what they mean and when APIs return them.
HTTP Basic Auth Header
Build or decode HTTP Basic Authorization headers, UTF-8 safe.
MIME Type Lookup
Look up the MIME type for an extension, or the extensions for a MIME type.
URL Parser
Break a URL into protocol, host, path, query parameters and hash.