Zero Signup ToolsFree browser tools

Developer Tools

cURL to PowerShell Converter

Convert a curl command to PowerShell. Pick Invoke-RestMethod, Invoke-WebRequest, or an idiomatic splatting script. Runs locally in your browser.

Or load a preset

The curl command is parsed locally in your browser. Tokens, headers, auth values, and request bodies never leave your device.

What gets converted

Method and URL
-X / --request sets the method passed to -Method. Without it, a body forces POST and -G with -d folds data into the query string and forces GET, exactly the way curl does.
Headers and credentials
-H headers become entries in the -Headers hashtable. -u user:pass becomes a real PSCredential with -Authentication Basic, not a hand-built base64 header.
JSON and form bodies
-d values that parse as JSON become a PowerShell hashtable serialised with ConvertTo-Json -Depth 10, so you can edit fields in PowerShell rather than escaped strings. Form-urlencoded bodies become a hashtable so PowerShell sets the Content-Type for you.
Multipart and cookies
-F parts use the PowerShell 7+ -Form hashtable, with file entries opened by Get-Item. Cookie strings from -b are loaded into a WebRequestSession so the request authenticates the way the original curl call did.

How to use

  1. Paste a curl command on the left, or click Load sample to start with a typical POST plus JSON body example.
  2. Pick one of the preset commands below the input (GET with query string, POST JSON, form-urlencoded login, basic auth, multipart upload, PUT with cookie) to see the converter working on common shapes.
  3. Choose an output style: Invoke-RestMethod for a typed API response, Invoke-WebRequest for the full response object, or Splatting script for a reusable @params pattern.
  4. Read the summary card for the detected method, URL, header count, and body type, then copy the generated PowerShell with the Copy code button.
  5. Check any warnings for ignored flags (-o, --proxy, --max-time) or parameters that need PowerShell 6+ / 7+ so you can adjust the script for Windows PowerShell 5.1 if needed.

About this tool

cURL to PowerShell Converter takes a curl command (the kind you copy from API documentation, browser DevTools Copy as cURL, or a Postman export) and turns it into PowerShell code you can run immediately. The parser tokenizes the command the way a POSIX shell would: single-quoted arguments stay literal, double-quoted arguments respect the standard backslash escapes, $'...' ANSI-C quoting expands the common control codes, backslash line continuations are folded, and short flags can be glued together (so -XPOST and -X POST both parse). It understands the flags people actually use: -X / --request for the method, -H / --header for headers, -d / --data, --data-raw, --data-binary, --data-ascii, and --data-urlencode for bodies, -F / --form for multipart parts (including @file references), -u / --user for HTTP Basic, -b / --cookie for the Cookie header, -A / --user-agent and -e / --referer for those convenience headers, --compressed and -k / --insecure as flags whose PowerShell equivalents are spelled out, --url as an explicit URL form, and -G / --get to fold a data body into the query string. The method is inferred when -X is missing: a body forces POST, otherwise GET, with -G overriding back to GET. Bodies that parse as JSON are converted to a real PowerShell hashtable serialised with ConvertTo-Json -Depth 10, so you can edit fields as PowerShell values rather than escaped strings. Form-urlencoded bodies become a hashtable that PowerShell submits as application/x-www-form-urlencoded for you, and raw bodies pass through as single-quoted literals. Three output styles cover the searches Windows-shop developers actually run: Invoke-RestMethod with -Method, -Headers, -Body, -Form, -Credential, -Authentication Basic, -WebSession, and -SkipCertificateCheck for typed API consumers that want a PSCustomObject back; Invoke-WebRequest with the same parameter set plus -UseBasicParsing and explicit access to StatusCode, Headers, and RawContent for ops engineers who need response metadata; and a splatting script that builds a $params hashtable, calls Invoke-RestMethod @params, and wraps the call in try/catch with stream-based error body capture, which is the shape Microsoft Graph, Azure, Exchange Online, and Active Directory runbooks reach for. Basic auth becomes a real PSCredential built from ConvertTo-SecureString rather than a hand-built base64 header. Cookie strings are loaded into a WebRequestSession with System.Net.Cookie entries scoped to the request hostname. Multipart -F parts use the PowerShell 7+ -Form parameter with Get-Item for file references so the snippet stays idiomatic. The converter calls out parameters that depend on a specific PowerShell version (-SkipCertificateCheck and -Form require 6+ / 7+) and lists any curl flags it had to skip. Useful for porting API docs into PowerShell automation, rewriting curl-based runbooks for Windows servers, building reproductions on a Windows workstation, and getting a typed PSCustomObject response in one paste. Parsing and formatting run entirely in your browser, so the URLs, bearer tokens, basic-auth credentials, cookies, and JSON bodies pasted here never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools