Skip to main content
QUIETLYTIC
Developer

cURL Converter

Turn a pasted curl command into a fetch call or Python requests snippet.

Local · nothing leaves this browser Waiting for a curl command
Esc Clear
fetch

Paste a curl command on the left.

Python requests

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

From the intelligence desk