All tools

cURL Converter

Convert cURL commands to JavaScript, Python, Go and PHP code.

Browser onlyYour input is processed in this browser and is not sent to SpeedyTools servers.
Share:
cURL Command
javascript
// Paste a cURL command above to convert
About cURL conversion

cURL is a command-line tool for making HTTP requests. API docs and browser DevTools often give requests as cURL commands. This tool rewrites them in the language your code uses, so you don't have to retype headers and bodies by hand.

It parses the cURL command and generates the same request with its method, headers and body.

Features
Convert cURL to JavaScript (fetch)
Convert cURL to Python (requests)
Convert cURL to Go
Convert cURL to PHP
Handles headers and body data
Converts as you type
Common use cases

API testing

Turn a request copied from the browser into code for a test

Code migration

Move cURL commands from shell scripts into your application code

API docs examples

Turn the cURL examples in API docs into code

Prototyping

Get a starting snippet for calling a new API

Frequently asked questions

How do I convert cURL to code?

Paste your cURL command into the input field. The tool generates the same request in JavaScript, Python, Go and PHP. Pick a language tab and copy the code.

What does the cURL command extract?

The tool reads the URL, the HTTP method from -X or --request, headers from -H or --header and the request body from -d, --data, --data-raw or --data-binary, so commands from a browser's Copy as cURL work. It then writes the same request in each target language.

How do I get a cURL command?

In Chrome, open DevTools (F12), go to the Network tab and make your request. Right-click the request and select 'Copy as cURL'. Firefox DevTools works the same way.

Why use different languages?

API docs usually give examples as cURL, but your project may be in JavaScript, Python, Go or PHP. The tool turns the example into code for the language you use.

Private by default

All conversion happens in your browser. Your data never leaves your device.