Home › Developer Tools › cURL Command Builder

cURL Command Builder

Build a correct curl command without memorizing flags: pick the method, enter the URL, add query parameters, headers, a JSON, form, multipart or file body, authentication and options. The command updates as you type, is quoted correctly for Bash, Windows CMD or PowerShell, and comes with a preview of the raw HTTP request.

Last updated:

Start from:

Values are URL-encoded for you. Query strings typed into the URL are moved here automatically.

Your curl command


    
HTTP request preview

    

The command is built locally in your browser. Nothing is sent: this page never contacts the URL you enter.

Advertisement
Advertisement

How to use the cURL Command Builder

  1. Choose a starting point such as GET JSON API, POST JSON or Upload a file, or start blank.
  2. Set the method and URL, then add query parameters and headers in their tabs.
  3. Add a body on the Body tab: JSON, a form, multipart fields and files, raw text or a binary file.
  4. Set authentication and options like follow redirects, timeouts, retries or an output file.
  5. Pick your shell (Bash, CMD or PowerShell), review any warnings, then press Copy command and paste it in your terminal.

Common curl options at a glance

ShortLongWhat it does
-X--requestSets the HTTP method (PUT, PATCH, DELETE…)
-H--headerAdds a request header; -H 'Name;' sends it with an empty value
-d--dataSends a form-encoded body and switches to POST
--jsonSends JSON with the right Content-Type and Accept headers (curl 7.82+)
-F--formMultipart field; name=@file uploads a file
-u--userBasic auth credentials as user:password
-L--locationFollows 3xx redirects
-i--includePrints response headers before the body
-I--headSends a HEAD request and shows headers only
-o--outputSaves the response to a file
-f--failExits with an error (code 22) on HTTP 400 and above, useful in scripts
-sS--silent --show-errorHides the progress meter but still prints errors
-m--max-timeGives up after this many seconds in total
-w--write-outPrints variables such as %{http_code} or %{time_total} after the transfer

Quoting rules by shell

  • Bash and zsh: single quotes keep everything literal, so JSON can be pasted as is. A single quote inside the value is written as '\''. Variables like $API_TOKEN only expand inside double quotes.
  • Windows CMD: only double quotes work, and inner double quotes become \". Use ^ at the end of a line to continue the command. Long JSON bodies are easier to keep in a file: -d @body.json.
  • PowerShell: call curl.exe, not curl. Single quotes are literal (a quote inside is doubled), a backtick continues the line, and $env:NAME reads an environment variable. Before PowerShell 7.3, embedded double quotes must also be escaped as \".

Need the same request in Python, JavaScript or PHP? Paste the finished command into the cURL to Code Converter.

Frequently asked questions

How do I send JSON with curl?

Set the Content-Type header and pass the body with --data-raw (or -d): curl -H 'Content-Type: application/json' --data-raw '{"name":"Ada"}' https://api.example.com/users. Since curl 7.82 you can use --json '{...}', which also sets Accept: application/json and uses POST automatically.

Why is there no -X POST in my command?

curl switches to POST by itself when you pass -d, --data-raw, --data-urlencode or -F, so -X POST is redundant. Adding -X POST is harmless, but combining -X with -L can keep the wrong method after a redirect, so the builder only adds -X when it changes something.

What is the difference between -d, --data-raw, --data-urlencode and -F?

-d sends data as application/x-www-form-urlencoded and treats a leading @ as a file name. --data-raw is the same but never reads files. --data-urlencode encodes the value for you. -F sends multipart/form-data, which is needed to upload files with name=@path.

Why does my curl command fail in PowerShell?

In Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest, so you must call curl.exe. PowerShell versions before 7.3 also strip double quotes from arguments passed to programs, so JSON needs \" escapes. Pick the right PowerShell option and the builder handles both.

How do I upload a file with curl?

For an HTML-style form upload use multipart: curl -F 'file=@./photo.jpg' -F 'title=Holiday' https://example.com/upload. To send the file as the raw request body use --data-binary @file with a Content-Type header, or -T file for a PUT upload.

Is it safe to put tokens in a curl command?

It works, but the command, including the token, is saved in your shell history and may appear in process lists. Tick Use environment variables to reference $API_TOKEN, $API_PASSWORD or $API_KEY instead, and set them in your session first.

Does this tool send the request?

No. It only builds the command text in your browser and never contacts the URL. Run the command in your own terminal, or use an API request tester if you want to send it from the browser.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.QR Code GeneratorMake QR codes for links, Wi-Fi, email and more.Barcode GeneratorCreate Code 128, EAN-13, UPC-A, EAN-8, Code 39 and ITF-14 barcodes as PNG or SVG.UUID GeneratorGenerate UUID v4 and v7 / GUIDs in bulk and copy or download them.Schema Markup Generator (JSON-LD)Create JSON-LD structured data for FAQ, Product, Article and more.Htaccess & Nginx Redirect GeneratorBuild 301 redirects for .htaccess, Nginx and Netlify or Cloudflare _redirects.Fake Data GeneratorGenerate mock data as JSON, CSV or SQL.Random String GeneratorGenerate secure random strings and tokens in bulk with any length and character set.API Key GeneratorCreate secure API keys and secrets with prefixes, checksums and SHA-256 hashes for storage.MIME Type LookupFind the MIME type for any file extension, or the extensions for a MIME type, in 400+ entries.Cron Expression GeneratorBuild crontab schedules visually, read them in plain English and see the next run times.URL Slug GeneratorTurn titles into clean, SEO-friendly URL slugs: accents, stop words, separators and bulk lines.JSON Schema GeneratorTurn sample JSON into a draft 2020-12 JSON Schema with types, required fields and formats.Gitignore GeneratorBuild a .gitignore from 50+ templates for languages, frameworks, IDEs and OS, merged and deduped.License GeneratorCreate a LICENSE file for MIT, Apache, GPL, BSD, ISC, MPL or Unlicense with your name and year.ULID GeneratorGenerate sortable ULIDs and UUID v7 in bulk, monotonic option, and decode their timestamps.Htpasswd GeneratorCreate .htpasswd entries with bcrypt, APR1-MD5 or SHA-1 for Apache and Nginx basic auth.Placeholder Image GeneratorCreate placeholder images in any size, color and text as PNG, JPG, WebP, SVG or data URI.Ads.txt GeneratorCreate or validate ads.txt and app-ads.txt files: seller lines, cert IDs and variables.Docker Run to Compose ConverterConvert docker run commands to docker-compose.yml, or a compose file back to docker run.Dockerfile GeneratorGenerate a production Dockerfile and .dockerignore for Node, Python, Go or a static nginx site.HTML Boilerplate GeneratorTick the options you need and get a clean HTML5 starter template with meta, OG tags and CSS reset.JSON to Zod SchemaInfer a Zod (or Yup) schema from sample JSON with optional, nullable and z.infer types.Linux Commands Cheat SheetSearchable Linux and bash command reference with flags explained, examples and copy buttons.LLMs.txt GeneratorBuild an llms.txt file for AI crawlers: summary and link sections, import from your sitemap.Nano ID GeneratorGenerate secure Nano IDs with custom alphabet, length and count, plus a collision calculator.Nginx Config GeneratorBuild an nginx server block: static site, SPA, reverse proxy or PHP, with SSL, gzip and redirects.OpenAPI / Swagger ViewerView OpenAPI 2/3 JSON or YAML as interactive API docs with validation and an endpoint list.package.json GeneratorFill a form and get a valid, npm-ready package.json with scripts, dependencies and checks.PKCE Code Challenge GeneratorGenerate an OAuth 2.0 PKCE code_verifier and S256 code_challenge, build auth URLs, verify pairs.README GeneratorFill in a form and get a polished README.md with badges, install, usage and license, live preview.Regex GeneratorBuild regular expressions visually from blocks or presets (email, date, phone) and test them live.Commit Message GeneratorBuild Conventional Commit messages with type, scope, body, breaking change and issue refs.Database Schema DesignerDesign tables and relationships visually, then export SQL for MySQL, PostgreSQL or SQLite.Docker Compose GeneratorBuild a docker-compose.yml with a form: services, ports, volumes, env, healthchecks and presets.Prettier Config GeneratorToggle Prettier options, preview formatted code live and copy your .prettierrc file.Quartz Cron GeneratorBuild and explain Quartz and Spring cron expressions with seconds, ?, L, W and #, plus next fire times.README Badge GeneratorCreate Shields.io-style README badges for license, version, build and custom labels.Systemd Service File GeneratorCreate a systemd .service unit with ExecStart, user, restart policy, environment and hardening.tsconfig.json GeneratorBuild a tsconfig.json with target, module, strict checks and path aliases, each option explained.Access Log AnalyzerAnalyze Apache and Nginx access logs: top URLs, IPs, status codes, bots and traffic charts.Regex String GeneratorGenerate random test strings that match any regular expression, checked against the real regex.ASCII Table GeneratorTurn CSV or pasted cells into plain-text tables: MySQL, Markdown, Unicode box and reST styles.Dummy File GeneratorCreate test files of an exact size in KB, MB or GB with zeros, random bytes or text.FFmpeg Command GeneratorPick a task and options, get the exact ffmpeg command with every flag explained.Folder Tree GeneratorTurn a local folder or an indented list into an ASCII directory tree for your README.GitHub Actions Workflow GeneratorBuild a GitHub Actions CI workflow: triggers, matrix, caching, tests, Pages or Docker deploy.Kubernetes YAML GeneratorGenerate Deployment, Service, Ingress, ConfigMap, Secret and HPA manifests with safe defaults.Markdown TOC GeneratorGenerate a linked table of contents from Markdown headings with GitHub-style anchors.OpenAPI EditorEdit OpenAPI/Swagger YAML or JSON side by side with live API docs, validation and download.OpenAPI ValidatorValidate OpenAPI 3.0/3.1 and Swagger 2.0 specs: schema errors, broken $refs, line numbers.Pivot Table MakerBuild pivot tables from CSV or Excel by drag and drop: sum, count, average, charts, export.SQL Query BuilderBuild SELECT queries visually: joins, filters, GROUP BY, ORDER BY and LIMIT, as clean SQL.Truth Table GeneratorType a logic expression and get its full truth table, minterms and canonical DNF/CNF.TypeScript PlaygroundWrite TypeScript with live type checking, see the compiled JavaScript and run it in your browser.Article Schema GeneratorCreate Article, BlogPosting or NewsArticle JSON-LD with headline, authors, dates and images.Event Schema GeneratorCreate Event JSON-LD with dates, venue or online location, tickets, organizer and performers.Google Search Query BuilderBuild advanced Google searches with site:, filetype:, intitle:, exact phrases and date operators.HowTo Schema GeneratorCreate HowTo JSON-LD with steps, tools, supplies, total time and cost, then copy it.Htaccess GeneratorBuild an Apache .htaccess file: HTTPS, www, gzip, caching, error pages, IP blocks, hotlinks.HTML Email Template BuilderDrag and drop blocks to build a responsive, table-based HTML email with inline styles.Organization Schema GeneratorCreate Organization JSON-LD with logo, URL, contact points, address and social profiles.PIN GeneratorGenerate random 4, 6 or 8-digit PINs that avoid sequences, repeats, dates and common PINs.Product Schema GeneratorBuild Product JSON-LD with price, availability, brand, GTIN, ratings and reviews.Question Keyword GeneratorFind the questions people ask about a topic, grouped by who, what, why, how, can and more.
See all 85 Code Generators & Builders →