cURL Command Builder
Build a runnable cURL command from method, headers and body.
Enter an HTTP method, URL, headers and request body, and this tool builds a ready-to-run curlcommand for you. You no longer need to memorise quote escaping or the order of -X,-H and --data options — the command updates as you type, ready to copy straight into your terminal.
It is handy for debugging APIs, testing REST endpoints, or attaching a reproducible request to docs and issues. Everything runs entirely in your browser, so the URL, tokens and body you enter are never sent to any server — you can safely build requests that include authentication headers.
How the command is assembled
The tool composes your input in the following order. For readability each option is split onto its own line with a trailing backslash (\), but the command works identically pasted as a single line.
- Method: added as
-X POSTwhenever it is notGET. - URL: wrapped in single quotes to stop the shell from interpreting special characters.
- Headers: each key/value pair becomes
-H 'Content-Type: application/json'. - Body: appended via
--datawhen the method is notGET/HEADand the body is non-empty.
Quoting and escaping
In a shell, text inside single quotes is passed through literally with no variable substitution or escaping, which makes it the safest wrapper. The catch is that a single quote inside the value would terminate the string, so this tool converts each inner single quote into the '\'' pattern to embed the quote safely. Values full of double quotes, such as JSON bodies, can be pasted as-is.
Practical tips
- For authenticated APIs, add an
Authorizationheader row in the formBearer <token>. - When sending JSON, also add a
Content-Type: application/jsonheader so the server parses it correctly. - To inspect only response headers, switch the method to
HEADand the body field disappears automatically.
Going the other way, when you need to dissect a long command someone sent you, the cURL command parser breaks the method, URL, headers and body back out into tables.