cURL Generator

Build a correct cURL command from a URL, method, headers and body.

API Runs in your browser
Request
Query parameters
Headers
Body
Options
Command

No command yet

Enter a URL to start. The command updates as you type, with quoting correct for the shell you pick.

Runs entirely in your browser. Your data isn't uploaded — this page makes no network request with anything you type, which you can verify in your browser's network tab. How this works.

What is the cURL Generator?

cURL is the lingua franca for describing an HTTP request: it goes in bug reports, runbooks and documentation because it runs anywhere. Writing one by hand is fiddly, though — quoting a JSON body inside a shell string is where most people go wrong.

Fill in the method, URL, headers and body here and get a correctly quoted command back, either as a single line or wrapped across lines for readability, with quoting appropriate for bash, PowerShell or cmd.

How to use it

  1. Enter the URL and pick a method.
  2. Add headers as name/value pairs; common ones are available as presets.
  3. Choose a body type — JSON, form, raw or none — and paste the body.
  4. Pick your shell and line style, then copy the generated command.

Example

A POST with a JSON body, generated for bash.

Input
POST https://api.example.com/v1/jobs, Content-Type: application/json
Result
curl -X POST 'https://api.example.com/v1/jobs' \
  -H 'Content-Type: application/json' \
  -d '{"name":"nightly-sync","enabled":true}'

Features

  • Correct quoting for bash, zsh, PowerShell and cmd
  • Single-line or multi-line output with line continuations
  • JSON, form-urlencoded, multipart and raw bodies
  • Header presets for content type, authorization and user agent
  • Query parameter builder with automatic encoding
  • Optional flags for following redirects, timeouts, insecure TLS and verbose output

Frequently asked questions

Why is my JSON body breaking in the shell?
Double quotes inside a double-quoted shell string need escaping. The generator wraps JSON bodies in single quotes for bash, which avoids the problem entirely — unless the JSON itself contains a single quote, in which case it switches strategy.
Is my request sent from this page?
No. This tool only builds the command text — nothing is requested and nothing you type is transmitted. Any tokens you paste stay in your browser, and are excluded from the share link.
Why does PowerShell need different output?
PowerShell parses quotes differently, and older versions alias curl to Invoke-WebRequest, which takes different arguments entirely. The PowerShell mode accounts for both.
Esc

Loading the catalog…