curl Command Builder
Assemble a copy and paste curl command without memorizing flags. Pick a method, type the URL, list your headers and body, and the builder emits a command with the matching Content-Type and every value wrapped in single quotes. It updates as you type, so the command in the output box always reflects the request you have described.
How to build a curl command
- Choose the HTTP method from the Method dropdown and type the request URL in the URL field.
- Add each request header as a name and value pair, using the + Add header button for more rows.
- Set the Body Type to Raw, JSON or Form, then type or paste the request body.
- Tick Follow redirects (-L), Insecure (-k) or Compressed if the request needs them.
- Read the generated curl command under the output heading and click Copy to grab it.
Examples
GET with an Accept header
GET https://example.com, header Accept: application/json
curl -H 'Accept: application/json' 'https://example.com'
POST a JSON body (the default form)
POST https://api.example.com/users, header Authorization: Bearer t0ken, JSON body {"name":"Ada"}curl -X POST -H 'Authorization: Bearer t0ken' -H 'Content-Type: application/json' --data '{"name":"Ada"}' 'https://api.example.com/users'POST a form field
POST https://api.example.com/search, Form body search=hello world
curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'search=hello world' 'https://api.example.com/search'
Frequently asked questions
Does it set the Content-Type automatically?
Yes. A JSON body adds Content-Type: application/json and a form body adds application/x-www-form-urlencoded. If you already list a Content-Type header yourself, the builder leaves it alone and does not add a second one.
How are values with spaces or quotes handled?
Every header, body and URL is wrapped in single quotes, and any embedded single quote is rewritten as the '\'' sequence. That makes the command safe to paste into a POSIX shell such as bash or zsh without the shell splitting or mangling your data.
What is the difference between the Raw, JSON and Form body types?
Raw and JSON both send the body with --data and differ only in the default Content-Type: JSON adds application/json while Raw adds nothing. Form switches to --data-urlencode and sets application/x-www-form-urlencoded, so curl percent-encodes the field when the request runs.
Why does a plain GET not show -X GET?
GET is curl's default method, so adding -X GET would be noise. The builder only emits -X when the method is something other than GET, or when a GET request unusually carries a body, which keeps the command clean.
Can I attach a body to a GET request?
Yes. If you type a body while the method is GET, the builder adds -X GET and the --data flag so the intent is explicit. Note that many servers ignore a body on a GET, so this is mainly for APIs that expect it.
What do the -k, -L and Compressed options do?
-k (Insecure) tells curl to skip TLS certificate verification, useful for self-signed certs but unsafe in production. -L (Follow redirects) makes curl chase 3xx redirects. Compressed asks the server for a gzip or brotli response that curl then decompresses.
Can I add more than one header?
Yes. Use + Add header for each extra row, and remove a row with the x button beside it. Rows whose header name is left blank are skipped, so a half-filled row will not break the command.
Does it percent-encode form fields for me?
No, the encoding happens inside curl. With a form body the builder uses --data-urlencode, which instructs curl to percent-encode the data at send time. The command you copy shows the readable text, and the wire encoding is applied when you run it.
Is anything sent to a server?
No. The command is assembled entirely in your browser, so the URL, headers and body you enter never leave your device. The tool builds text; it does not execute the request.
Learn more
- Anatomy of a curl command
Break down a curl request into method, headers, body flags and the URL, and learn which flag to reach for in common API calls.
Related tools
curl to code
Paste a curl command and get clean JavaScript fetch and Python requests code. Parses method, headers and body. Runs in your browser.
HTTP Header Builder
Build CORS, cache and security response headers, then copy them as raw HTTP, Nginx add_header or Apache Header set lines. Runs in your browser.
URL Parser
Parse a URL into protocol, host, port, path, query and hash. See every query parameter in a clean table. Free, private and runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.