Skip to main content
API & Developer Testing Tools

cURL Generator

Generate a valid, copyable cURL command from a method, URL, query parameters, headers, body, and optional basic auth.

Fill in the method, URL, headers, query parameters, and body below to generate a valid, ready-to-run cURL command.

The generated command runs entirely on your own machine when you paste it into a terminal - nothing is sent from this page.

What Is a cURL Generator?

cURL is a widely used command-line tool for making HTTP requests. Its flag syntax (-X, -H, -d, and so on) is powerful but easy to get wrong by hand, especially with quoting. This generator builds a correctly escaped cURL command from a simple form.

Why Use This Tool?

Useful for documentation, support tickets, sharing a reproducible request with a teammate, or quickly testing an endpoint from a terminal without recalling exact cURL flag syntax.

How to Use the cURL Generator

  1. Choose a method and enter the URL.
  2. Add query parameters and headers as needed.
  3. Enter a request body for methods that support one.
  4. Optionally add a basic auth username and password.
  5. Copy the generated command and paste it into your terminal.

Example

Method GET, URL https://api.example.com/status, header Accept: application/json generates:

curl -X GET "https://api.example.com/status" \
  -H "Accept: application/json"

Related

Already have a cURL command and need it in a specific programming language instead? Use the cURL to Code Converter.

Frequently Asked Questions

Use -X POST (or PUT/PATCH), add -H "Content-Type: application/json" and pass the body with -d '{"key":"value"}'. The generator adds these for you when you enter a JSON body.

cURL's -u user:password option sends an Authorization: Basic header containing the Base64-encoded credentials. Base64 is not encryption, so only use it over HTTPS.

It works as-is in Linux, macOS and Git Bash. In Windows Command Prompt single quotes are not supported, so replace them with double quotes and escape inner double quotes, or use PowerShell's curl.exe.
Share this tool: