Skip to content

cURL Command Converter — Go, PHP, Node & Python

Paste a curl command and convert it to Go, PHP, Node or Python source, with headers, auth and body preserved — parsed locally by this tool's own tokenizer.

Runs in your browser; nothing is uploaded.

Runs in your browser; the command is parsed locally and never executed or sent anywhere.

Paste a curl command to convert it to Go, PHP, Node or Python.

How to use it

How to convert a curl command

  1. Paste a curl command, including a multi-line one that uses backslash continuation.

  2. The tool recognises -X/--request, -H/--header, -d/--data/--data-raw/--data-urlencode, --json, -u/--user, -F/--form, -G/--get, -k/--insecure, -L/--location and -b/--cookie.

  3. Choose Go, PHP, Node or Python from the tabs to see the equivalent request in that language.

  4. An unrecognised flag doesn't stop the conversion — it's listed as a warning and the rest of the command is still parsed.

A few things carry over exactly as curl would use them: -G moves any -d data into the URL's query string (with proper percent-encoding), -u user:pass becomes HTTP Basic auth (base64-encoded, since some HTTP clients like Node's fetch have no built-in option for it), and -k becomes a comment noting that TLS certificate verification is disabled — never a silently-applied setting.

Everything is parsed by a small tokenizer built for this tool; nothing is executed, and the command never reaches a server.

Frequently asked questions

Does this tool actually run the curl command?

No. It only tokenizes the command text (splitting flags, quoted arguments and the URL) and builds an equivalent request description, which is then rendered as Go, PHP, Node or Python source. Nothing is executed and no network request is made, by this tool or on your behalf.

Why does -u user:pass produce a base64 string in the Node output?

Node's built-in fetch has no dedicated basic-auth option, so the only way to send it is a manually-built Authorization: Basic <base64(user:pass)> header — which is exactly what real curl does under the hood, and what the generated code shows explicitly.

What happens with a flag the converter doesn't recognise?

It's reported as a warning (e.g. "--frobnicate is not supported and was ignored") and parsing continues with the rest of the command, so one unusual flag doesn't block the whole conversion.

Can it convert a curl -F file upload?

It recognises -F [email protected] as a multipart field and reproduces the field name, but a warning notes that the actual file contents can't be embedded — this tool never reads files from your machine, so the generated code needs the real file path filled in.