cURL to Code Converter

Paste a cURL command and get the equivalent code in JavaScript, Python, Go or PHP as you type.

The cURL to Code Converter parses your cURL command (method, headers, cookies, request body, multipart form fields and basic auth) and generates equivalent code for JavaScript (fetch), Python (requests), Go (net/http) and PHP (cURL). Options it cannot convert are listed as warnings. No data leaves your browser.

About This Tool

How to Use
  1. Paste a cURL command into the input area
  2. Select your target language: JavaScript, Python, Go or PHP
  3. The code updates as you type; check any warnings about unsupported options
  4. Copy the output code to use in your project
Common Use Cases
  • Converting browser DevTools cURL exports to production code
  • Translating API documentation examples to your language
  • Quickly prototyping API integrations
  • Sharing API calls in a team's preferred language
Tips & Tricks
  • Copy cURL commands from your browser's Network tab (right-click a request → Copy as cURL)
  • The converter handles headers, cookies (-b), POST bodies (-d, --json), multipart forms (-F) and basic auth (-u)
  • Options that cannot be converted, such as certificates or file-based data, are listed as warnings

Related Tools