cURL Command Converter

Convert cURL commands to PHP (Guzzle), Python (requests), JavaScript (fetch), Go, and Ruby code. Paste any curl command and get ready-to-run code in your language of choice.

How to use the cURL Converter

Paste any curl command into the input field. The converter parses every flag and generates equivalent, ready-to-run code in PHP (Guzzle), Python (requests), JavaScript (fetch), Go (net/http), or Ruby (Net::HTTP). Use the language tabs to switch output and the Copy button to copy to your clipboard.

Supported cURL flags

The converter handles the most common curl options:

Multi-line commands using backslash line continuations (\) are supported.

Frequently Asked Questions

How do I send JSON with curl?

Use -H "Content-Type: application/json" -d '{...}', or the shorthand --json '{...}' (curl 7.82+). The converter detects the Content-Type and generates the appropriate JSON body syntax for each language — for example, Guzzle's 'json' option or requests' json= parameter, both of which handle serialisation automatically.

How do I send form data?

Use -d "key=value&key2=value2" for URL-encoded form data (application/x-www-form-urlencoded) or -F "key=value" for multipart form data (used for file uploads). The converter maps these to form_params / multipart in Guzzle, data= / files= in requests, and FormData in the JavaScript fetch API.

How do I add basic authentication?

Pass -u username:password. The converter generates native auth options for each language: Guzzle's 'auth' array, requests' auth= tuple, a base64-encoded Authorization: Basic … header for fetch, Go's req.SetBasicAuth(), and Ruby's request.basic_auth().

What does -k / --insecure do?

It disables TLS certificate verification. This is useful for self-signed certificates in development but should never be used in production. The converter maps this to 'verify' => false in Guzzle, verify=False in requests, InsecureSkipVerify: true in Go's TLS config, and VERIFY_NONE in Ruby.

Related tools