cURL to Code Converter

Paste a cURL command — including a devtools “Copy as cURL” — and get working request code in the language you actually ship.

Works with devtools “Copy as cURL” from Chrome, Firefox, and Safari — including multi-line commands with \, ^, or backtick continuations.

  

Runs entirely in your browser. Nothing you paste here is uploaded, logged, or sent to analytics.

The workflow this is for

Open devtools, find the request that worked, right-click → Copy as cURL, paste it here. That string carries every header, cookie, and body the browser sent, which is why reproducing a working request by hand so often fails — you miss one header.

All three major browsers' formats are handled, including the Windows cmd and PowerShell variants with their ^ and backtick line continuations.

Flags that are understood

FlagHandled as
-X / --requestHTTP method. Without it, a body implies POST and its absence implies GET.
-H / --headerRequest header. Values containing colons are kept intact.
-d, --data, --data-raw, --data-binaryRequest body. Repeated flags are joined with &.
--data-urlencodeBody, with the value percent-encoded.
--jsoncurl 7.82+ shorthand — body plus both JSON content-type headers.
-F / --formMultipart field. @filename becomes a file reference in the generated code.
-u / --userHTTP Basic credentials, emitted using each language's idiomatic mechanism.
-b / --cookieSplit into pairs and re-emitted as a Cookie header.
-G / --getMoves the data into the query string rather than the body.
-L, -k, -I, -A, -eRedirects, TLS verification, HEAD, User-Agent, Referer.

Anything not understood is reported as a warning rather than silently dropped, so you know the generated code is incomplete instead of finding out in production.

Where the languages genuinely disagree

  • Redirects. curl does not follow redirects unless you pass -L. Go's http.Client and Python's requests both do by default. The generated code compensates in each direction so behaviour matches the command you pasted, not the library's default.
  • TLS verification. -k has no fetch() equivalent at all — browsers do not let a page opt out of certificate checking, and in Node it is a process-wide environment variable. The output says so rather than pretending.
  • JSON bodies. Python's requests gets json=, which handles encoding and the content-type header itself; the others get a serialized string. JSON literals are translated to Python's True/False/None.
  • Multipart uploads. fetch and requests and PHP each have a first-class way to express these. Go's net/http requires mime/multipart boilerplate, so the output lists the fields as comments rather than emitting code that looks complete but is not.

Your credentials stay here

A "Copy as cURL" string almost always contains a session cookie or a bearer token. Parsing and code generation both happen in your browser — the command is never transmitted, logged, or sent to analytics. That is the entire reason this page exists rather than pointing you at one of the server-side converters.

Do still strip the token before pasting the generated code into a shared repository.