cURL command builder for HTTP requests and APIs

Build a cURL command for an HTTP request without memorizing its flags. Enter a URL, choose the request settings, and copy the command into your terminal. The builder prepares the command; you run it when ready.

Loading the tool…

What is a cURL command?

cURL is a command-line tool for transferring data. For HTTP work, a command describes the URL, request method, headers, and any body you want to send. A reusable command is useful when exploring an API, reproducing a request, or sharing a small example with a teammate.

The command uses shell quoting to preserve literal values, including apostrophes and dollar signs. The body is literal text, not a filename, and is not automatically JSON-validated or URL-encoded. HEAD retrieves response headers without a response body. GET and HEAD omit your body draft; switching back restores it.

Basic options

OptionPurpose
Method and URLChoose the request method and destination.
Content-TypeChoose JSON, form-encoded text, plain text, or cURL’s default. For a body, cURL normally defaults to application/x-www-form-urlencoded.
Accept JSON responsesAdd Accept: application/json.
Custom headersAdd up to 10 headers, with 8,192 characters in total. Empty values and duplicate names are rejected.
Request bodyInclude up to 65,536 characters of literal text. Tabs and line breaks are allowed; other control characters are rejected.
Accept self-signed certificatesAdd --insecure, which disables TLS certificate and hostname checks, not just rejection of self-signed certificates. Leave it off for normal use.
Verbose outputAdd --verbose for connection and header details. Review logs before sharing them because they may include credentials.
Short optionsUse -X, -I, -H, -k, and -v instead of their long forms. Put the quoted URL last, without --url. --data-raw stays unchanged so a body starting with @ is treated as text.
Single-line outputProduce one physical command line, using Bash/Zsh quoting to preserve body line breaks.

Open Advanced options for option style, command layout, insecure TLS, and verbose output. It starts collapsed with readable long flags, multiline output, and normal certificate checks selected. The method, URL, header presets, custom headers, and command stay visible; the body editor appears for methods that support it.

Header and body limits count JavaScript string units; some characters such as emoji use two units. URLs have no imposed length or format restriction; cURL interprets them when run. The builder neither executes nor tests the request, and the command does not follow redirects automatically. Running the copied command contacts the destination using the options you selected. Commands containing secrets may remain in your terminal history.

Use Clear request beside the URL to reset all options, or clear the custom headers and body separately. Reloading the page also discards the request. If copying is unavailable, select the generated command and copy it manually.

Example requests

To retrieve a page, choose GET and enter a URL. The generated command is equivalent to:

curl --url 'https://example.com/'

For a JSON request, choose POST, select application/json, and enter {"name":"Example"} as the body:

curl --request 'POST' \
  --url 'https://example.com/api/items' \
  --header 'Content-Type: application/json' \
  --data-raw '{"name":"Example"}'

With Short options selected, the same request becomes:

curl -X 'POST' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"Example"}' \
  'https://example.com/api/items'

cURL accepts a URL without --url; the builder places it last for readability. If the entered value starts with a dash, it adds -- before that value so cURL treats it as a URL rather than an option. This does not make an invalid URL valid.

These are illustrative URLs, not a working API. Replace them with your endpoint and review the command before running it. The examples use POSIX shell quoting, matching the builder’s default multiline output.

How to use this tool

  1. Choose a method and enter the URL. Use GET to retrieve a resource, or select the method required by your API. Include the full URL, for example https://example.com/api/items.
  2. Set headers if needed. For JSON, select application/json under Content-Type. Accept JSON responses requests a JSON response. Add custom headers as Name: value, one per line; do not repeat a name already supplied by a preset.
  3. Enter a body when supported. For a JSON POST, for example, enter {"name":"Example"}. The builder treats it as literal text and does not validate JSON. GET and HEAD omit the body; switching back restores your draft.
  4. Review the generated command. It updates as you edit. Correct any field errors to restore the output. Expand Advanced options to choose Short options for compact flags with the URL last, or Single-line output for one physical line.
  5. Copy and run it. Select Copy command, then paste it into a terminal with cURL installed. Default output works in POSIX shells such as Bash or Zsh; single-line output requires Bash or Zsh. Neither format is intended for PowerShell or Windows Command Prompt. The builder itself does not send the request.

Use Clear request beside URL to start over. Leave Accept self-signed certificates off for normal use because it disables certificate checks. Verbose output helps inspect connection details, but review logs before sharing them because they can contain credentials.

Your tool data stays in your browser

This tool processes your data on your device. The text, files, or passwords you enter and the results it creates are not sent to our servers or any other server.

Page and asset requests still occur. Production pages also load Google Tag Manager and AdSense advertising; tool code does not send inputs or results to analytics or ads. See our privacy policy.

To inspect requests while using the tool, open your browser's developer tools and select Network. Try it with sample data.

Read How to check website network requests in Chrome, Firefox, Edge, and Safari.

Learn more

Premium is coming soon

An optional premium subscription to remove ads is planned. Subscriptions are not available yet.

You can keep using our free tools without an account.