cURL Command Generator
Runs entirely in your browser
Build a curl command from a method, URL, headers, query params and body. This never sends the request for you.
What is cURL Generator?
cURL Generator turns a method, URL, query parameters, headers, body and optional basic-auth credentials into a ready-to-run curl command, so you don't have to remember flag syntax or manually quote values.
How to use cURL Generator
- Choose a method and enter the URL.
- Add any query parameters, headers, or a request body.
- Copy the generated command and run it in your terminal.
Features
- Supports GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS.
- Query parameters are appended and encoded automatically.
- Safely quotes headers, body and URL for POSIX shells.
- Optional HTTP Basic Authentication support.
- Never sends the request itself — you stay in control.
- 100% client-side — nothing is sent to a server.
Example
Setting Method to POST, URL to https://api.example.com/users, a header Content-Type: application/json, and body {"name": "Ada"} generates:
curl -X POST -H 'Content-Type: application/json' -d '{"name": "Ada"}' 'https://api.example.com/users'
Note there's no -X GET for a plain GET request — curl already defaults to GET, so the method flag is only added when it's something else.
Tips
- Every value is wrapped in single quotes with embedded single quotes escaped as
'\''— this is correct for bash, zsh and sh, but if you're pasting into Windows PowerShell you'll need to convert the quoting style yourself. - Filling in only one of the Basic Auth username or password fields still adds a
-u 'user:pass'flag with the other side left blank — fill in both if the target API expects real credentials. - Query parameters are appended to the URL with
encodeURIComponent()on both the key and value, so spaces and special characters are percent-encoded automatically — you don't need to encode them yourself before pasting. - This tool never sends the request — always review a generated command before running it, especially if it includes credentials or a body you pasted from somewhere else.
Is cURL Generator safe?
Yes. The single-quote escaping and encodeURIComponent() encoding described in the Tips above run locally in your browser — the URL, headers, body and credentials you enter are used only to build the command text and are never uploaded to our servers.
Frequently Asked Questions
Does this send the request for me?
No. It only generates the curl command text. You run it yourself in a terminal.
How are special characters handled?
Values are wrapped in single quotes and any embedded single quotes are escaped, so the generated command is safe to paste into a POSIX shell (bash, zsh, sh).
Can I add basic authentication?
Yes. Fill in the username and password fields to add a -u flag to the generated command.