Loading Techie Utils…

cURL to JavaScript Converter

Paste a curl command and get the same request written in JavaScript. Free, and runs entirely in your browser — nothing you enter is uploaded or stored.

About cURL Builder

Builds an HTTP request from its parts — method, URL, query parameters, headers, a JSON, form, multipart or text body, basic or bearer authentication, redirects, timeout and proxy — and writes it as a curl command and as working code in twenty languages and clients: JavaScript with fetch or axios, TypeScript, Node's https module, Go, Python with requests or httpx, PHP with cURL or Guzzle, C# HttpClient, Java HttpClient, Kotlin OkHttp, Swift URLSession, Ruby, Rust reqwest, Dart, PowerShell, HTTPie, wget and the raw HTTP request. Choose every language at once to see them side by side.

The details are handled for you. Query parameters are percent-encoded and appended to the URL; a JSON body is checked before anything is written and sets Content-Type: application/json; a form body is URL-encoded; a multipart line written as key=@path becomes a real file upload in every language; a bearer token becomes the Authorization header.

Or start from a command you already have. Switch to pasting a curl command — from API docs or a browser's Copy as cURL — and it is read the way a shell reads it, with quotes, $'…' escapes, line continuations and combined flags such as -sSL, then converted with curl's own rules for -d, -G, --json, -F, -u, -L, -k, -m and -x.

A JSON body becomes a native structure where the language makes that natural — a dict in Python, an array in Guzzle, serde_json::json! in Rust — and anything a language cannot express, such as browser fetch setting a Cookie header, is listed rather than silently dropped.

Where it helps

  • Builds a request field by field, or reads a pasted curl command — both produce the same code.
  • Twenty languages and clients plus the curl command itself, including every one at once for comparison.
  • Encodes query parameters and form bodies, validates JSON, and sets the Content-Type each body needs.
  • Writes multipart uploads with real file handling, and basic or bearer authentication in each client's own way.
  • Reads pasted commands like a shell: quotes, ANSI escapes, line continuations and combined short flags.
  • Lists the options a language cannot express instead of silently dropping them.
  • Runs in the browser and sends nothing, which matters for a request that carries a live token.

Limits

  • It writes requests; it does not send them, so it cannot show you the response.
  • Tokens and passwords are copied into the generated code as typed — move them into configuration before committing.
  • Shell variables such as $TOKEN in a pasted command are kept as literal text, because the command is never run.
  • Browser fetch cannot set some headers (Cookie, User-Agent, Host) or skip certificate checks; those work only from Node.
  • Swift and java.net.http have no simple multipart builders, so those languages note the gap instead of writing one.

Frequently asked questions

Why is there no -X POST in my curl command?

Because curl already sends POST when there is a body, and writing -X POST as well is redundant — and with -L it changes how redirects behave. The method is written only when curl would not choose it by itself, such as PUT, PATCH or DELETE.

How do I upload a file?

Choose Multipart form as the body and write the file as key=@path/to/file on its own line, with any other fields as key=value. Each language then opens and streams that file — curl's -F, requests' files=, Go's multipart.Writer, and so on.

Why is my Cookie or User-Agent header ignored in the browser?

Browsers forbid scripts from setting Cookie, Host, User-Agent, Referer, Origin and Content-Length. The same fetch code sets them from Node, Deno or Bun; in a browser, cookies are sent automatically when credentials: 'include' is set and the server allows it.

What does skipping certificate checks do?

It accepts any certificate, including a forged one — curl's -k, verify=False in Python, InsecureSkipVerify in Go. It exists for local development against self-signed certificates; fix the certificate rather than shipping it.

Is my token sent anywhere?

No. The request is only written, never sent, and all of it happens in the browser. The token does appear in the generated code exactly as typed, which is why the summary hides it until you ask to see it.

Related tools

  • CORS Generator — Write CORS configuration for nginx, Express, Go, Django, ASP.NET, Spring and more, and test an origin against it
  • CSP Generator — Build a Content-Security-Policy, or check one, and write it for your server or framework
  • Query String Parser and Builder — Convert query strings into editable key-value data
  • HTTP Headers — Grade a site's security headers from A+ to F, see every response header, and get the fix for your server
  • HTML Formatter — Indent and tidy HTML markup
  • CSS Formatter — Format stylesheets with consistent indentation

More Web Development tools