cURL Command Builder

Build or parse supported cURL requests with editable header rows and request examples.

On-device No sign-up Free to use

Build request controls

Showing an example. Edit to see your own.

?

The full address, starting with http:// or https://.

?

One header per line, written as Name: value. Each name may appear once.

?

Sent with --data-raw, so a body that starts with @ stays literal. GET and HEAD cannot carry a body; leave it empty for those.

?

Optional. Adds an Authorization: Basic header to every snippet.

?

Used in read mode. Paste a command that starts with curl.

Mode

Processed in your browser. Your inputs stay on this device.

Result

Showing an example.

Draft a JSON POST request and compare its cURL, fetch, Python and PHP forms.

Built a POST request to https://api.example.com/v1/orders with 1 header and a body.

Loading the tool. Your result will appear here.

https://usefreetools.net/curl-command-builder · 20 November 2026

Was this helpful?

How to use cURL Command Builder

  1. Choose Build a command and enter the method, URL, headers and optional body, or choose Read a pasted command and enter a supported cURL command.
  2. For a new request, use one header per line or the editable header rows. Bodies are supported for POST, PUT, PATCH and DELETE; leave the body empty for GET, HEAD or OPTIONS.
  3. Read the cURL, JavaScript fetch, Python requests and PHP curl drafts and any parser notes. The page prints them without making a request.
  4. Review the destination, credentials and client-specific restrictions before copying. The cURL quoting is for POSIX shells such as sh or bash; PowerShell and Windows command-prompt quoting differ.

Example: cURL Command Builder

Draft a JSON POST request and compare its cURL, fetch, Python and PHP forms.

You add
Mode: build; Method: POST; URL: https://api.example.com/v1/orders; Headers: Content-Type: application/json; Request body: {"item": "book", "qty": 2}; cURL command to read: curl -X POST https://api.example.com/v1/orders -H "Content-Type: application/json" --data-raw '{"item": "book", "qty": 2}'
You get
Built a POST request to https://api.example.com/v1/orders with 1 header and a body.

Options

Mode
Build mode uses the method, URL, headers, body and optional Basic auth fields. Read mode uses only the pasted command and derives its supported request settings.
Method
Choose GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS. This builder allows a body only with POST, PUT, PATCH or DELETE. HEAD uses cURL -I so it does not wait for a response body.
URL
The full address, starting with http:// or https://.
Headers
One header per line, written as Name: value. Each name may appear once.
Request body
Sent with --data-raw, so a body that starts with @ stays literal. GET and HEAD cannot carry a body; leave it empty for those.
Basic auth (user:password)
Optional. Adds an Authorization: Basic header to every snippet.
cURL command to read
Used in read mode. Paste a command that starts with curl.

Supported inputs and limits

  • Up to 50 header lines, 20,000 characters per text field and 20,000 characters for a pasted command.
  • The reader understands -X, -H, -d, --data-raw, --data-binary, --data-ascii, --json, -u, --url, -A, -b, -e and -I.
  • Flags outside that set are refused by name, including -K, -o, -T, -O, -x, -w, -D, -F, -G, -k, -L and --compressed, because they read or write files, route traffic elsewhere, or change the response in a way the printed snippets do not rebuild.
More details

A -d, --data, --data-binary or --json value that starts with @ is refused, and -b without an = is treated as a cookie file and refused; use --data-raw for literal text that starts with @. -d, --data and --data-ascii strip carriage returns and newlines, so a multi-line value through those flags is refused; --data-raw keeps the line breaks.

An empty -d '' is read as POST with an empty body, which is what cURL sends.

Shell expansion and operators ($, backtick, $(...), ;, |, &, >, <) are refused, because the read value would not be the text the shell produced; a single-quoted or escaped value is literal and is kept as it is.

HEAD requests print with -I, since -X HEAD alone makes cURL wait for a body.

All four snippets describe the same method, URL, headers and body, with redirects off and the same content type, but they are not interchangeable across every environment: the JavaScript snippet runs under browser rules, where forbidden headers such as Host and Content-Length are dropped, cross-origin requests need CORS, and credentials follow the browser's rules.

Nothing is executed here: the tool prints text and never sends a request.

The editable header grid supports up to 30 rows; the advanced header text accepts up to 50.

Generated cURL quoting targets POSIX shells, not PowerShell or Windows command prompt.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

Reading a command back is deliberately narrow

Several cURL options read files or change how a request is sent. The reader maps the supported request flags and refuses the rest. When it refuses a flag, enter the supported parts in the builder fields and check the generated command before using it.

Questions about cURL Command Builder

Does this page send my request?

No. The tool only prints the command and the code snippets. Nothing is fetched, and the URL, headers and body stay in this browser.

Why does a value in the cURL command have quotes around it?

Any value with a space, quote, dollar sign or newline is wrapped in single quotes so the shell passes it through unchanged. An embedded single quote is written as close-quote, escaped quote, open-quote, which is the standard way to keep it literal.

Why was my pasted command refused?

Some flags read or write files on your computer, send a multipart upload, move the data into the query string, or change how the response is handled. That covers -K, -o, -T, -O, -x, -w, -D, -F, -G, -k, -L and --compressed. The result names each flag it will not model, so the command you keep is one the printed snippets really match.

Does the Python or PHP snippet include my password?

If you fill Basic auth, every snippet includes your credentials in a Base64 Authorization header. Base64 is readily decoded and does not hide the password. Clear the field before sharing a snippet, and use an environment variable for credentials in real code.

Will all four snippets behave the same on the network?

They send the same method, URL, headers and body, with redirects turned off, but the browser's fetch is bound by browser rules. It cannot set a forbidden header such as Host or Content-Length, a cross-origin call needs the target to allow CORS, and cookies follow the browser's credential rules rather than your machine's cookiejar. Treat the JavaScript snippet as the browser version of the request, not as a byte-for-byte copy of cURL.

Page updated · Project managed by Tony Hines · Report a problem with cURL Command Builder