curl to code converter
Runs entirely in your browser. Your files and data never leave your device.
About this tool
Paste a curl command and this tool turns it into working request code for JavaScript’s fetch, axios, or Python’s requests library. It reads the URL, method, headers, body, form fields, cookies, and basic auth straight out of the command line, so you can pick a target and get code that matches what curl would actually send.
Which curl flags does it understand?
The parser tokenizes the command the way a shell would, handling single and double quotes, backslash escapes, and line continuations, so a multi-line command copied from a terminal works as-is. It reads -X/--request for the method, -H/--header for headers, -d/--data/--data-raw/--data-binary/--data-urlencode for the body, -F/--form for multipart form fields (including file fields marked with an @), -u/--user for basic auth, -b/--cookie, -A/--user-agent, -e/--referer, and -G/--get for turning data into a query string instead of a body. It also picks up -k/--insecure and adds a comment noting that TLS verification was disabled in the original command, since that’s easy to miss when reading generated code. Flags it doesn’t recognize are listed as warnings rather than silently dropped, so you know if something in the original command didn’t make it into the output.
When the body looks like JSON (based on a Content-Type header containing “json”), the generated code parses and re-serializes it as a proper object literal instead of a raw string, giving you JSON.stringify(...) in JavaScript or a Python dict in the requests output. Form-urlencoded bodies get the same treatment, turning into URLSearchParams or a Python dict rather than an opaque string.
Is my curl command uploaded anywhere?
No. Parsing and code generation happen entirely in your browser. The curl command never leaves your machine, which matters when it carries an API token, a session cookie, or an internal hostname you’d rather not paste into a random web form.
Common uses: turning a curl snippet copied from API docs or a browser’s network tab into a fetch call for your frontend, converting a support ticket’s repro steps into a Python script, or checking what headers and body an axios request actually needs to match a working curl command. See the curl man page for the full flag reference and MDN’s fetch guide for the JavaScript side.