Skip to content

curl Command Generator

Fill in a method, URL, headers, an auth mode and a body, and get a ready-to-paste curl command with values quoted correctly for a POSIX shell — including embedded single quotes, which most people escape wrong on the first try.

  • GET, POST, PUT, PATCH, DELETE and more
  • Bearer token or Basic auth, added as the right flag
  • Correct POSIX shell quoting, including embedded single quotes
  • Multi-line output with line continuations for readability
  • Runs fully client-side

Generator

Built in your browser, never sent anywhere

Headers

Enter a URL to generate the command.

How to generate a curl command

  1. 01

    Pick the method and enter the URL

    GET, POST, PUT, PATCH, DELETE and a few others are supported.

  2. 02

    Add headers and a body, if needed

    The body only gets included for methods that use one.

  3. 03

    Set auth, if needed

    Bearer adds an Authorization header; Basic adds curl's -u flag.

  4. 04

    Copy the command

    Paste it directly into a terminal.

Why the quoting is the actual point of this tool#

Building a curl command by hand is mostly typing; getting the shell quoting right is the part that actually goes wrong. A JSON body pasted straight into a terminal without quotes gets torn apart by the shell at every space and special character. Wrapping it in single quotes fixes that — except if the body itself contains an apostrophe, which single quotes cannot escape from the inside at all. The correct fix is closing the quote, inserting an escaped literal quote, and reopening it ('…'\''…'), which is exactly what this tool generates automatically for any value that needs it.

Why the body doesn't show up for a GET request#

curl accepts -d on any method, but a GET request with a body is unusual enough that most HTTP servers and libraries either ignore it or reject it outright — the semantics of GET explicitly don't include a request body in the HTTP spec. This tool leaves the body out for GET and HEAD specifically to avoid generating a command that looks reasonable but does not behave the way most servers expect.

Bearer versus Basic: two different auth mechanisms, two different flags#

Bearer auth is just a header (Authorization: Bearer <token>) — nothing curl-specific about it, so this tool adds it as a plain -H flag alongside any other headers. Basic auth is different: curl has a dedicated -u user:pass flag that handles the base64-encoding curl needs internally, so this tool uses that flag rather than trying to construct the Authorization: Basic header by hand.

Frequently asked questions

Why does the body have a stray quote-escape sequence like '\''?

That is the correct way to include a literal single quote inside a single-quoted shell string — close the quote, add an escaped quote character, reopen the quote. It looks unusual but it is the standard POSIX-safe approach, generated automatically whenever your body or a value contains an apostrophe.

Why is there no body field showing up for a GET request?

GET requests don't semantically carry a body in the HTTP spec, and most servers ignore or reject one. This tool omits -d for GET and HEAD to avoid generating a command that looks fine but behaves unpredictably.

What is the difference between Bearer and Basic auth here?

Bearer just adds a plain Authorization header with your token. Basic uses curl's dedicated -u user:pass flag, which handles the base64 encoding curl needs internally rather than constructing the header by hand.

Is my data sent anywhere?

No. The command is assembled entirely in your browser — nothing you enter is transmitted.

Developers

UUID Generator

Generate cryptographically random UUID v4 or time-ordered UUID v7, in bulk.

Developers

Base64 Encoder & Decoder

Encode and decode Base64 with correct UTF-8 handling, including the URL-safe alphabet.

Developers

ULID Generator

Generate ULIDs — sortable by creation time like UUID v7, but Crockford Base32 instead of hex.