cURL Command Generator

Describe your API request in a form and get the cURL command, quoted correctly for your terminal. Pick macOS or Linux, Windows cmd or PowerShell, add headers, a bearer token or basic auth, and a JSON, form or multipart body. Switch the output to fetch(), Axios or HTTPie for the same request. Nothing is sent; the page only writes the command.

Query parameters
Headers
Authentication
Body
Output
Shell

Writing the code runs in your browser. What you type never leaves this device.

This page only writes the code. It never sends your request or sees your token.

Features

  • GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS

  • Bearer token, basic auth or an API key header, written as the right header

  • JSON, URL-encoded form, multipart upload (-F file=@path) or raw text bodies

  • Quoting for bash and zsh, Windows cmd (curl.exe) and PowerShell

  • Query parameters encoded for you and merged into the URL

  • One click to see the same request as fetch(), Axios or HTTPie

When a cURL command helps

Testing an API before writing code

Check that an endpoint, token and payload work from the terminal before you wire them into your app.

Sharing a reproducible bug report

Paste one command into a ticket or Slack so a teammate sees exactly the request that failed.

Webhooks and server scripts

Call a webhook or trigger a job from a cron script, CI step or a server without a browser.

Following API docs on Windows

Most docs show bash quoting. Switch to cmd or PowerShell and the quotes and line breaks are rewritten for you.

Writing cURL commands that work

The options that matter

  • -X sets the method. cURL already uses POST when you send a body, so -X POST is not needed then.
  • -H adds a header, for example -H 'Authorization: Bearer <token>'.
  • --data-raw sends the body exactly as written; --data-urlencode encodes form values for you.
  • -F sends multipart form data. Start a value with @ to upload a file: -F [email protected].
  • --head (or -I) makes a HEAD request and shows only the response headers.

Quoting on Windows

Windows 10 and 11 include curl.exe. In cmd, wrap values in double quotes and escape the quotes inside JSON as \". In PowerShell, call curl.exe rather than curl, because curl is an alias for Invoke-WebRequest in Windows PowerShell 5.1. The generator writes both forms, with ^ or a backtick at the end of each line.

Keep tokens out of shared commands

A command with a real token in it is a working credential. Before you paste one into a ticket or chat, replace the token with a placeholder such as YOUR_API_TOKEN, or read it from an environment variable: -H "Authorization: Bearer $API_TOKEN".

cURL Command Generator - FAQ