cURL Command Generator
Free online cURL command generator tool, visual configuration
About Curl Generator
Builds a ready-to-paste curl command from a small form. You pick an HTTP method, supply a URL, optionally list headers (one per line), and optionally provide a request body — the tool emits a multi-line `curl -X ...` invocation with each header on its own `-H` line and the body on a `-d` line, all single-quoted and line-continued for terminal readability.
How to Use
1. Click one of the method pills (GET / POST / PUT / PATCH / DELETE) in the Method card. 2. Enter the full URL in the URL card (defaults to https://api.example.com/users). Generate is disabled while the URL is empty. 3. (Optional) Add request headers in the Headers card, one per line as `Name: Value` (defaults to `Content-Type: application/json`). 4. (Optional) For POST, PUT, or PATCH, a Body card appears — paste your payload there. GET and DELETE never include a body, even if the field has content. 5. Click Generate Curl, then use Copy in the output card to copy the command to your clipboard.
Output Formatting Rules
The generated command is assembled as follows: - Base: `curl -X METHOD 'URL'` (method and URL always single-quoted). - Each non-empty header line is appended as `\ -H 'Name: Value'` on its own indented line. - The body is appended as `\ -d 'BODY'` only when the method is POST, PUT, or PATCH and the body is non-empty. - Every continuation uses a backslash-newline (`\\\n`) followed by two spaces, so the command pastes cleanly into bash/zsh. Note: values are wrapped in single quotes verbatim. If your URL, header, or body contains a single quote, you must escape it manually for your shell before running the command.
▶Why is my body not included in the generated curl command?
▶How are headers with a colon in the value handled?
▶Does the tool execute the curl command for me?
▶What happens if my URL or body contains a single quote?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee