cURL Converter
Turn a pasted curl command into a fetch call or Python requests snippet.
Paste a curl command on the left.
Paste a curl command on the left.
How it works
Parses a shell-quoted curl command — handles single and double quotes, and a trailing backslash line continuation — and reads the flags people actually paste from a browser's "Copy as cURL": method, headers, body, and basic auth credentials.
Not a real shell
This is a tokenizer, not a shell interpreter — it follows POSIX quoting (single quotes, double quotes with their
backslash rules, and bash's $'…' form that Chrome's "Copy as cURL" uses) but does not expand
variables or run command substitution. -G moves -d data into the query string, as curl
does. Options with no equivalent in the snippet — output files, timeouts, proxies, multipart -F forms
— are skipped and listed under the generated code, never mistaken for the URL.
Example
Basic auth (-u alice:secret) becomes an Authorization: Basic header in the fetch output
— the fetch API has no basic-auth option of its own, only a native browser credential prompt for cross-origin
requests, so the generated snippet encodes the credentials the same way curl sends them on the wire.
Frequently asked questions
Where do I get a curl command to paste in?
Most browsers' Network panel in devtools has a "Copy as cURL" option on any request — right-click a request and look for it. That is the most common source of what gets pasted here.
Why does -u become an Authorization header in the fetch output?
Basic auth is not a fetch option — the browser only offers it through a native credential prompt for cross-origin requests. The generated snippet instead base64-encodes the credentials into an Authorization: Basic header directly, which is what curl itself does on the wire.
Related tools
URL Parser
Split a URL into scheme, host, path, query and fragment.
LocalJSON Formatter & Validator
Format, validate and measure JSON, with errors located by line and column.
LocalRegex Explainer
Turn a regular expression into a plain-English, line-by-line breakdown.
LocalTimezone Converter
Convert a date and time between IANA time zones, or find the gap between two instants.
LocalJSON Schema Validator
Validate a JSON document against a JSON Schema and see exactly which rule failed, and where.
LocalDocker Compose Validator
Check a Compose file for the mistakes that stop it loading — before you find out with docker compose up.
Local