cURL Converter
Convert cURL commands to JavaScript, Python, Go and PHP code.
// Paste a cURL command above to convert
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.
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
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.
Related tools
JSON Formatter
Format JSON online in your browser. Paste or upload JSON to tidy it with 2 or 4 space indents, find syntax errors, minify it or browse it as a collapsible tree.
JavaScript to JSON
Convert JavaScript object literals to valid JSON
JSON Merge
Merge two JSON objects online with a deep or shallow strategy and choose how arrays combine. Useful for config files and API responses. Free, no signup.