Developer Utilities · Free tool
cURL Command Builder
Build a complex cURL command with headers, auth, and a JSON body using a simple online form. Copy it for instant use, free and no signup.
None.
curl command
Advertisement
What it does
curl is the universal command-line HTTP client — created by Daniel Stenberg in 1996, shipped on virtually every Unix system, macOS, modern Windows, embedded in countless scripts and Docker images. Building curl commands by hand is error-prone because the flag system is dense (-X for method, -H for headers, -d for body, -u for basic auth, -G for GET-with-data, -k for skip-cert-check, --data-urlencode for URL encoding, -L for follow redirects, etc.) and quoting bugs are common across shells (bash, zsh, PowerShell, cmd all handle quotes differently). The builder produces correctly-quoted curl commands from a structured form, so you don't fight quote-escaping when copying to a terminal or CI script.
The builder accepts: URL, HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS), headers (key-value pairs — Authorization, Content-Type, Accept, custom), query parameters (auto-URL-encoded), request body (JSON, form-data, raw text, or file upload), authentication (basic auth user:password, bearer token, custom Authorization header), and options like timeout, follow-redirects, ignore-cert-errors, output to file. Output: a copy-pasteable curl command in your shell flavor (bash/zsh, PowerShell, cmd, or format-on-multiple-lines for readability).
Common use cases: testing API endpoints (most APIs have curl examples in their docs), one-off API calls before writing formal client code, sharing a debug command with teammates (curl is universal), embedding API calls in CI / cron scripts, troubleshooting webhooks (replay incoming webhooks via curl), and capturing requests from browser DevTools (Network tab → Right- click → Copy as cURL — the tool can also parse this format and let you tweak it). Beware: curl commands often contain sensitive data (auth tokens, API keys) — treat as secret, don't paste in public channels without redacting first.
Embed this tool on your siteShow snippetHide
Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.
<iframe src="https://freetoolarena.com/embed/curl-command-builder" width="100%" height="720" frameborder="0" loading="lazy" title="cURL Command Builder" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>How to use it
- Enter the URL.
- Pick the HTTP method (GET, POST, etc.).
- Add headers (Authorization, Content-Type, custom).
- Add query parameters (auto-URL-encoded) and request body if needed.
- Set authentication (basic auth or bearer token).
- Pick shell flavor (bash, PowerShell, cmd) and copy the result.
When to use this tool
- Testing API endpoints quickly without writing client code.
- Reproducing browser-DevTools requests outside the browser.
- Sharing debug requests with teammates (curl is universal across systems).
- Embedding HTTP calls in CI / cron / shell scripts.
- Webhook replay — capturing an incoming webhook and replaying via curl to test handlers.
When not to use it
- Production application code — use a proper HTTP library (axios, fetch, requests, OkHttp) for real apps.
- GraphQL — better tooling exists (GraphQL Playground, Apollo, Insomnia) than crafting curl by hand.
- Long-running streaming requests (SSE, WebSocket) — curl can but it's painful; use dedicated tools.
- When you need a GUI-friendly REST client — Postman, Insomnia, Bruno, Hoppscotch are better for exploratory API work.
Common use cases
- Verifying a number or output before passing it on
- Quick generation during a typical workday
- Pre-decision sanity-check on inputs and outputs
- Educational use — demonstrating the underlying concept
Frequently asked questions
- What's the difference between -d and --data-urlencode?
- -d sends the data as-is in the request body. --data-urlencode URL-encodes the data first (replacing spaces with +, special chars with %XX). For form posts (application/x-www-form-urlencoded), --data-urlencode is correct because spaces and = signs need encoding. For JSON bodies, -d is correct because JSON has its own encoding. The builder picks the right flag based on your content-type.
- Why does my curl command fail in PowerShell?
- Quote-escaping differs across shells. Single quotes work in bash/zsh but PowerShell treats them differently. PowerShell aliases “curl” to Invoke-WebRequest by default — different syntax entirely. Two fixes: (1) use real curl.exe (modern Windows ships it; just use `curl.exe ...` or full path). (2) Generate the command in PowerShell flavor, which uses the right quoting style. The builder offers shell-flavor selection.
- How do I pass JSON as the body?
- Three options: (1) -d '{`{"key":"value"}`}' — single quotes around JSON in bash/zsh. (2) --data-binary @file.json — read JSON from a file (avoids quote-escaping pain). (3) Use --data-raw '...' to ensure curl doesn't try to interpret the data. Always include `-H "Content-Type: application/json"` header so the server parses correctly.
- How do I auth with a bearer token?
- Add `-H "Authorization: Bearer YOUR_TOKEN_HERE"`. Don't use `-u` (that's basic auth — sends user:password Base64-encoded, different mechanism). For API keys in custom headers: `-H "X-API-Key: yourkey"`. Always treat tokens as secret — don't paste them in public bug reports or shared scripts. Use environment variables (`$TOKEN`) in shell scripts.
- Can I follow redirects?
- Yes, add `-L`. Without `-L`, curl returns the 3xx response without following. With `-L`, it follows up to 50 redirects (configurable with --max-redirs). For testing, sometimes you DON'T want to follow (you want to inspect the redirect chain) — leave -L off and you'll see each intermediate response.
- How do I save the response to a file?
- `-o filename` to save to a specific name; `-O` to save with the URL's filename. For large downloads, `-C -` resumes interrupted transfers. For verbose debugging, `-v` shows headers and connection details. Combine: `curl -v -o output.txt -L -H "Authorization: ..." https://api.example.com/data`. The builder generates these patterns for common use cases.
Advertisement
Learn more
Guides about this topic
- Developers & Technical · GuideHow to measure password strengthAnalyze password strength using zxcvbn scoring, length over complexity, and attack models. A free online tool for breach-aware security, no sign-up needed in seconds.
- Using Our Tools · GuideHow to generate QR codesMake QR codes for URLs, WiFi, vCard, or text. Learn error correction and sizing, then generate your QR code online free with no sign-up in seconds.
- Using Our Tools · GuideHow to create a strong passwordGenerate a strong password instantly online for free. Build high-entropy passphrases following NIST 2026 rules with no download needed.
- Developers & Technical · GuideHow to encode and decode Base64Understand the 3-to-4 mechanic and 33% overhead for standard, URL-safe, and MIME Base64. Free online reference to avoid common mistakes, no download needed.
- Design & Media · GuideHow to choose a color paletteBuild accessible color palettes using HSL theory, monochromatic to triadic schemes, WCAG contrast checks, and dark mode tips. Free, no-download guide.
- Developers & Technical · GuideHow to use JWT tokens securelyImplement secure JWT authentication by choosing RS256, setting expiration, using httpOnly cookies, and preventing 'alg: none' attacks in your browser for free.
Explore more developer utilities tools
- Port Number LookupSearch over 140 well-known TCP and UDP ports by number or service name. Free online reference tool with no sign-up, covering web, mail, DNS, and more.
- Test Credit Card NumbersReference table of canonical test card numbers from Stripe, Adyen, and Braintree sandbox docs. Plus Luhn validator + network detector.
- IPv6 Expander & ShortenerFormat IPv6 addresses to canonical form, handling zone IDs and prefixes, instantly online—free tool with no registration required.
- Htpasswd GeneratorCreate .htpasswd lines for Apache or nginx basic auth with browser-only SHA hashing instantly. Includes config snippets and a free online tool with no registration.
- Chmod CalculatorCalculate Unix file permissions: octal (755, 644) ↔ symbolic (rwxr-xr-x) ↔ rwx checkboxes. Covers setuid, setgid, sticky bit. With presets.
- Excel Formula ExplainerPaste any formula and get a plain-English breakdown of 60+ functions online free—no sign-up required, in your browser.