Why this tool?
Every API vendor's documentation uses curl examples — it's the lingua franca of HTTP. But when you're writing a Node.js backend or a React app, you need that request in your language of choice: fetch, axios, or Node's built-in modules. Translating headers, method, body, and auth by hand is tedious and error-prone; an unescaped quote is enough to break a copy-paste.
What's supported
- URL & method —
-X/--request, defaults to GET (or POST if-dis present). - Headers — repeatable
-H/--header. - Body —
-d,--data,--data-raw,--data-binary,--data-urlencode. JSON bodies are kept as-is; form strings are detected and emitted accordingly. - Basic auth —
-u user:pass/--userbecomes anAuthorization: Basicheader. - Cookies —
-b/--cookiebecome aCookieheader (works in Node; browsers ignore this for security). - Multipart form —
-F/--formgeneratesFormDatacode. - GET with body —
-Gconverts-dpairs into a query string. - Line continuations — multi-line curl with trailing
\is normalised first.
Fetch vs Axios vs Node
Fetch is native in every modern browser and in Node 18+. It's the right default for new code. The downsides: non-2xx responses don't throw by default, timeouts need AbortController, and there's no built-in JSON body helper (you still call .json()). Axios is a popular third-party library that wraps XHR / Node's http module. It auto-parses JSON, throws on non-2xx, handles timeouts cleanly, and runs in legacy Node and IE. Node https is the low-level primitive — useful when you need streaming, proxies, or full control over TLS options.
Privacy
The entire conversion happens in your browser. No request is ever made to the URL in your curl command (this tool only generates code — it does not execute it). Nothing is logged or transmitted.
Related tools
- URL Encoder — for manually composing query strings.
- Base64 Encoder — for building Basic Auth headers by hand.
- JWT Decoder — inspect Bearer tokens from your curl headers.
