Convert a curl command into Invoke-RestMethod, with headers and body as variables
Runs in your browser. Nothing you type is sent anywhere. Updated on 25 Oct 2026.In Windows PowerShell, curl is an alias for Invoke-WebRequest, so a pasted curl command fails. The translation is mechanical: curl -H "Authorization: Bearer abc" https://api.example.com becomes Invoke-RestMethod -Uri https://api.example.com -Headers @{ Authorization = "Bearer abc" }. Paste any curl here and get that.
Paste the curl command into the curl command box; PowerShell is already selected.
Read the code: headers go into a $headers hash table and the body into a $body here-string.
Read the comments for switches such as -SkipCertificateCheck or -Form that need PowerShell 6 or later.
Press Copy, or download the code as request.ps1.
The output comes with a $headers hash table, a $body here-string, and the switches that need PowerShell 6 or later flagged.
Paste a curl command and get the same request written as browser fetch, Node fetch, Python requests, PowerShell Invoke-RestMethod or HTTPie. The command is split the way a shell would split it, so quoted values, escaped characters and lines joined with a backslash, a caret or a backtick all survive.
The flags people actually paste are handled: -X, -H, -d and every --data variant, --data-urlencode, --json, -u, -F and --form, -G, --compressed, -k, -b, -A, -e, -L, -I, -T, -x and --max-time. A JSON body is laid out as a real object rather than a long string, a form becomes FormData or files=, and -G moves the data into the query string without encoding it twice.
Where a target cannot do what curl did, the generated code says so instead of quietly producing something wrong. A page cannot turn off certificate checking or set a Cookie header, so those become comments. Multipart uploads drop an explicit Content-Type, because only the library knows the boundary. PowerShell switches that need version 6 are labelled.
The rest of the article, and all 6 questions about curl Converter, are on the curl Converter page.
Paste the whole command, starting with the word curl, and pick fetch. Headers become an object, -d becomes the body, a JSON body is written as JSON.stringify with the object laid out, and -u becomes an Authorization header built with btoa. Copy the result with one click.
In Windows PowerShell, curl is an alias for Invoke-WebRequest, which takes completely different arguments, so -H and -d are read as something else entirely. Convert the command to PowerShell here to get a real Invoke-RestMethod call, or install curl.exe and call it by its full name.
The --json flag is shorthand, added in curl 7.82, for three things at once: send this text as the body, add Content-Type: application/json, and add Accept: application/json. This converter expands it, so the generated code shows both headers explicitly.
Yes. Right-click a request in the Network tab and choose Copy as cURL. Those commands use --data-raw, --compressed and a long list of lower-case headers, and are often one very long line or several joined with backslashes. All of that is handled, including the $'...' form Chrome uses when a value contains newlines.
Still stuck? Ask about curl Converter and anybody who knows can answer. No account needed.
On the related tools: TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON · Query String Parser – Split a URL query string into a table of decoded parameters.
In the collection Developer Converters.