cURL Builder & Fetch Converter
Build cURL requests or convert supported cURL input to JavaScript fetch without running commands.
What the cURL and fetch converter does
The request builder turns structured method, URL, query, header, and body input into a POSIX-shell-quoted cURL command and a JavaScript fetch example. The converter tokenizes a supported pasted cURL command without executing it, then maps the request data to fetch syntax.
Parsing and security boundaries
- Shell substitutions, backticks, NUL bytes, malformed quoting, CRLF header injection, and unsupported options are rejected.
- Sensitive Authorization, Cookie, proxy authorization, and API-key values can be redacted in generated output and are redacted by default in the interface.
- POSIX shell quoting is not PowerShell or Windows cmd quoting. Review the target shell before running copied text.
- Repeated request headers may be combined by the Fetch Headers API; the generated snippet calls out duplicate names for manual review.
- The tool does not send a request, validate a remote server, store credentials, or prove that copied secrets are safe from extensions, page scripts, clipboard history, or screen sharing.
Why generated fetch may need changes
Browser fetch applies CORS and forbidden-header rules that the curl command-line client does not. Server-side JavaScript has another cookie, proxy, and TLS environment. Multipart form uploads, streaming request bodies, client certificates, custom DNS resolution, or curl-specific retry behavior require runtime-specific code beyond a direct conversion.
Related developer tools
Continue with CSP Header Builder & Analyzer, HTTP Headers Parser, URL Parser.
How to Use cURL Builder & Fetch Converter
- Build a request from fields or paste a supported cURL command.
- Keep sensitive-header redaction enabled when sharing or reviewing output.
- Copy the POSIX cURL command or JavaScript fetch snippet.
- Review shell, CORS, credential, redirect, and body semantics before running it.
Frequently Asked Questions
Does this tool run the cURL command?
- No. It only tokenizes supported input and generates text. It never starts a shell, contacts the target URL, or sends the headers and body.
Which cURL options can be converted?
- The converter handles common request options including method, URL, headers, and data, plus harmless location or compression flags. Unsupported or ambiguous shell features are rejected instead of guessed.
Are cURL and fetch always equivalent?
- No. Redirects, cookies, TLS, proxies, compression, streaming, CORS, browser-forbidden headers, credentials, and multipart uploads can behave differently. Review and test the generated code in its real runtime.
Sources & references
Primary references: curl command-line tool manual; WHATWG Fetch Standard; POSIX Shell Command Language: Quoting; RFC 9110: HTTP Semantics.
Last reviewed: