About cURL Formatter
A curl command copied from your browser's network panel or an API's documentation can run to dozens of options on one line, and it is hard to see what it does. Paste it here and choose a view: the same command with one option per line, a plain summary of the method, URL, headers and body, or the equivalent JavaScript fetch.
It also points out mistakes that are easy to miss. If a command sends JSON with -d but no content type, curl labels it as form data, and many servers then fail to parse it. Turning off certificate checks with -k gets flagged as well. The command is only read as text, so nothing is ever sent to the URL.
How it works
The command is split the way a shell would split it: single quotes, double quotes, $'...' strings, backslash escapes and line continuations in bash, Windows ^ and PowerShell backtick styles. Short flags are unpacked, so -sSL becomes three options and -XPOST becomes a method, and every short name is written out in its long form.
The method is then worked out with curl's own rules: -I means HEAD, -T means PUT, a body means POST, and -G moves the body into the query string. The formatted view quotes each value safely, so you can paste it back into a shell, and the summary pretty-prints a JSON body. The fetch view builds headers, adds Basic auth from -u and uses FormData for -F.
How to use cURL Formatter
- Paste the whole command, including the word
curl, into the curl command box. Upload and Try an example work as well. - Under Show, choose Formatted command, Request summary or JavaScript fetch.
- Read any warnings at the top of the result.
- Press Copy, or Download for
formatted-curl.sh,curl-summary.txtorrequest.js.
One command, in the fetch view
curl -sS -X POST 'https://api.example.com/v1/orders?notify=true' -H 'Content-Type: application/json' -H "Authorization: Bearer abc123" -d '{"sku":"A-1042","quantity":2}' --max-time 30const response = await fetch("https://api.example.com/v1/orders?notify=true", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer abc123"
},
body: JSON.stringify({
"sku": "A-1042",
"quantity": 2
})
});--max-time 30 has no direct fetch option, so it is left out. Use an AbortSignal with a timeout if you need the same behavior.
When it helps
- Reading a command from your browser's Copy as cURL menu to see what the request sends
- Turning an API documentation example into code for a front end or a Node script
- Tidying a command before pasting it into a README or a runbook
- Finding out why a request works in one tool and fails with curl, such as a missing content type
Tips for a better result
- Commands copied from a browser carry real cookies and tokens. Remove them before sharing, and rotate any you have posted somewhere public.
- Long option names make a command far easier to review, so keep the formatted version in scripts and documentation.
- Browser code cannot set some headers, such as
Cookie, and is subject to CORS. Generatedfetchcode may need a server to work exactly as curl did.
Good to know
- It reads the command and does not run it, so it cannot show you a response.
- Shell variables such as
$TOKENand substitutions are kept as literal text, because the page has no shell to expand them. - Only the first URL is summarized, and any other stray word gets a warning. Pipes after the command stay in the formatted view and are ignored by the other two.
- The
fetchview covers method, headers, body, forms and redirects. Options such as timeouts, proxies and retries have no equivalent there and are dropped, and files in-Fbecome a comment for you to fill in.
Questions people ask
Is my command sent anywhere?
No. The text is parsed by a script on this page and no request is made, even to the URL in the command. That matters, because such commands often hold API keys.
Why does it warn me about -d without a content type?
curl sends Content-Type: application/x-www-form-urlencoded by default with -d. If your body is JSON, servers may not parse it. Use --json or add the header yourself.
Can I paste a multi-line command?
Yes. Continuation lines ending in a backslash, a Windows ^ or a PowerShell backtick are all joined, and a leading $ prompt is ignored.
Does it warn about unknown options?
A short flag it does not know gets a warning and stays in the formatted command. An unknown long option is treated as a flag, so its value shows up as a stray word with a warning, and the formatted command still keeps it.
What to use next
- HTTP Header Parser: to read the headers that come back from the request
- URL Parser: to break down a long URL inside the command
- JSON Formatter: to read the response you get when you run it
Last reviewed . Read our editorial policy.