curl Command Generator and 'Copy as cURL' Parser
Short answer: fill in a method, URL, headers and body in the cURL Command Generator and copy a command you can paste into a terminal, a script or a bug report. Going the other way, paste a command you copied from the browser's Network tab ("Copy as cURL"), press Parse curl command, and the fields are filled in so you can edit and regenerate it. The tool only builds text. It never sends the request.
Building a command with the curl command generator
A default example: a POST to https://api.example.com/users with a Bearer token and a JSON body produces:
curl \
-X POST 'https://api.example.com/users?page=2&q=a%20b' \
-H 'X-Trace: abc' \
-H 'Authorization: Bearer TOKEN123' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"Ada"}'
Notice three things the tool did for you:
- the query values are percent-encoded (the space in
a bbecame%20; see the URL encoding guide); - the
Authorizationheader was built from the Auth setting; Content-Type: application/jsonwas added automatically because the body type is JSON.
If your Headers box already sets Authorization or Content-Type, your value wins, and the status line says so.
Authentication choices
None, Basic (encoded as Authorization: Basic …), Bearer token, an API key in a header, or an API key in the query string.
Going the other way: parse a pasted command
In your browser's developer tools, right-click a request in the Network tab and choose "Copy as cURL". Paste it into the tool and press Parse curl command. For example, a command with a body and an authorization: Bearer abc header becomes a POST, the URL and query parameter are separated, the header moves into the Bearer setting and options such as --compressed are ticked. Options the tool has no field for, such as -o, --retry or --proxy, are listed: some are dropped and some are appended to the regenerated command, as the note tells you.
The same request in other languages
The "Generated code" box writes the request as JavaScript (fetch or Axios), Python (requests or httpx), Go, PHP, Java, C# or curl.
Built-in checks
- A URL without
http://orhttps://, or with spaces, is flagged. - With the JSON body type, a body that does not parse as JSON is flagged. Find the error with the JSON Formatter or read JSON syntax errors.
After you run it
Look up the status in HTTP status codes explained, read the response headers in the HTTP Header Analyzer, and choose a Content-Type with the MIME Type Lookup.
Two safety notes
- Tokens are secrets. The page works in your browser and stores nothing, but a command containing a real token is still a secret. Replace it with a placeholder before pasting it into a ticket, chat or repository. If it leaks, read Leaked API key: what to do.
-kturns off certificate checks. Use it only against servers you control.
Windows quoting
The command uses single quotes, which Bash and zsh understand. Windows Command Prompt does not treat single quotes as quotes, so run it in Git Bash or WSL, or adapt the quoting.
Limits to know
- It builds commands. It is not a client that sends requests and shows responses.
- POSIX shell quoting only.
- Pasted options without a matching field may be dropped.
Frequently asked questions
Does the tool send the request? No. It only builds the command text.
How do I turn a browser request into curl? Use "Copy as cURL" in the Network tab and paste it into the tool.
How do I send JSON with curl?
Choose the JSON body type. The Content-Type header is added for you.
Why does my command fail on Windows? Single quotes do not work in Command Prompt.
Is it safe to paste a real token? Avoid it in anything you share. Use a placeholder.