cURL to Code Converter

Convert cURL commands to Python requests, JavaScript fetch, Go net/http, PHP curl, and Node.js axios code instantly. No signup, runs in your browser.

100% Client-Side Your data never leaves your browser Free · No Sign-Up
cURL Command
Generated Code

How to Use

  1. Paste your cURL command into the left panel.
  2. Click Convert.
  3. Select the target language tab (Python, JavaScript, Go, PHP, or Node.js).
  4. Click Copy to copy the generated code.

Supported Flags

  • -X METHOD — HTTP method (GET, POST, PUT, DELETE, etc.)
  • -H “Header: Value” — Custom request headers
  • -d / —data / —data-raw — Request body
  • -u user:password — Basic authentication
  • -L — Follow redirects
  • —cookie “name=value” — Cookie header
  • -F “field=value” — Multipart form data

Common Use Cases

  • API integration: Translate API examples from docs (usually cURL) into your preferred language.
  • Debugging: Copy a failing request from browser DevTools as cURL and convert it to test in code.
  • Onboarding: Help teammates who are unfamiliar with cURL understand what a request does.
  • Testing: Quickly scaffold HTTP calls without writing boilerplate by hand.

FAQ

What flags does the converter support?

The converter supports the most common cURL flags: -X (method), -H (headers), -d/--data/--data-raw (request body), -u (basic auth), -L (follow redirects), --cookie (cookie header), and -F (multipart form data).

Does this send my cURL command to a server?

No. All parsing and code generation happen entirely in your browser using JavaScript. Your cURL commands and any secrets they contain never leave your device.

Why does the generated code use 'await'?

The JavaScript (fetch) and Node.js (axios) examples use top-level await for clarity. In a real project you would wrap them in an async function or use .then() chains.

How are Basic Auth credentials handled?

When you use the -u user:password flag, the converter encodes the credentials as Base64 and adds an Authorization: Basic ... header to the generated code, exactly as cURL does.

What if my cURL command spans multiple lines?

Multi-line cURL commands using backslash line continuation are fully supported. Paste the entire command and the converter will handle the line breaks.