Developer Tools

cURL to Code Converter

Convert a cURL command into editable JavaScript, Python, Go, or PHP code in seconds. Your request stays in your browser.

Paste a command, select an output language, then copy the code.

Processed in your browser. The converter never sends a request to the URL or runs the generated code.

Methods, headers, inline data, cookies, basic authentication, and GET query data are supported.

Generated code
Your code will appear here

Paste a cURL command or load the example to get started.

How it works

From cURL to a working starting point

Turn a copied API request into code you can review and adapt for your project.

01

Paste your request

Copy a cURL command from documentation, a terminal, or your browser’s network tools.

02

Choose the target

Generate fetch, Axios, Python requests, httpx, Go, or PHP code.

03

Review and copy

Check the URL, headers, and body, then copy the snippet into your project.

What is converted?

The converter reads the HTTP method, URL, headers, cookies, basic authentication, and inline request data. It also handles cURL’s --get query data.

Before you use the code

Generated snippets are starting points. Review secrets before sharing them. Local files and multipart form uploads cannot be converted here.

FAQ

cURL conversion questions

How do I convert a cURL command to Python?

Paste the command above and choose Python requests or Python httpx from the output language menu. The code updates automatically.

Can I convert cURL to JavaScript fetch or Axios?

Yes. Select JavaScript fetch, Node.js fetch, or Axios. The generated snippet includes supported methods, headers, and inline data.

Does the converter send my API request?

No. Parsing and code generation run in your browser. The converter does not contact the request URL or execute the generated snippet.

Are file uploads and multipart forms supported?

No. Local file bodies and multipart form uploads are not converted. Paste request data inline with --data for supported body conversion.