cURL Converter

Paste a cURL command and instantly convert it into HTTP request code for popular programming languages. Method, headers, body and auth are parsed automatically — ready to copy and use.

Last updated: 2026/10/16 Developer Feedback & bug reports

Result
Enter a cURL command above and the converted code will appear here.

How to Use

1

Paste a cURL command

Paste a cURL command copied from your browser DevTools or an API documentation into the input field.

2

Choose a language

Pick a target language from the tabs: JavaScript (fetch), Python, Node.js, PHP, Go or Ruby.

3

Copy the code

Copy the generated code to your clipboard and paste it straight into your project.

About the cURL Converter

This tool converts cURL (Client URL) commands into HTTP request code for popular programming languages. Take a command from API docs or your browser's "Copy as cURL" and instantly turn it into fetch, requests, axios and more. All parsing happens locally in your browser — your command is never sent to a server.

Features

  • 6 LanguagesGenerates code for JavaScript (fetch), Python (requests), Node.js (axios), PHP (cURL), Go and Ruby.
  • Automatic ParsingParses method, headers, body, Basic auth, multipart forms and cookies automatically.
  • Safe Custom ParserNo eval is used — a custom parser handles quoting and line continuations correctly.
  • Fully In-BrowserAll conversion runs in your browser. Your command is never transmitted anywhere.

Use Cases

  • Port cURL examples from API docs to your language
  • Convert "Copy as cURL" from browser DevTools into code
  • Turn Postman/Insomnia cURL exports into code
  • Rewrite shell scripts as application code
  • Build sample snippets for API integration & learning

FAQ

Which cURL options are supported?
Supported: -X/--request (method), -H/--header, -d/--data/--data-raw/--data-urlencode (body), -F/--form (multipart), -u/--user (Basic auth), -b/--cookie, -A/--user-agent, -e/--referer, -G/--get and --url. Execution flags like -k, -L and -s are safely ignored.
Is my cURL command sent to a server?
No. All parsing and code generation happen entirely in your browser with JavaScript. Your command and any API tokens are never sent to any external server.
Which languages can I convert to?
Six targets: JavaScript (Fetch API), Python (requests), Node.js (axios), PHP (cURL extension), Go (net/http) and Ruby (Net::HTTP). Switch tabs to view each instantly.
Can it handle multi-line cURL commands with backslashes?
Yes. Line continuations using a trailing backslash (\) or Windows caret (^) are merged automatically before parsing, so you can paste multi-line cURL commands as-is.
Is the JSON body formatted?
When the Content-Type is application/json and the body is valid JSON, Python and Node.js output use native objects (dict / object). Other languages use the original string as the body.
How are API tokens and credentials handled?
Headers and credentials are reflected directly in the generated code but never leave your browser. When sharing generated code, we recommend removing tokens and other secrets first.