Back to Tools
Curl to Code Converter
Curl to Code Converter
Convert cURL commands to JavaScript, PHP, or Python code.
About the Curl to Code Converter
Convert a cURL command into code.
How to use the Curl to Code Converter
- Paste your code into the input box, or click Sample to load an example.
- Choose the language: JavaScript (Fetch), PHP (cURL) or Python (Requests).
- Press Process Now.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
curl -X POST https://api.example.com/data -H "Content-Type: application/json" becomes a matching fetch, PHP or Python request.
Tips
- Copy a cURL command from your browser's developer tools (Network tab) and paste it here.
Frequently Asked Questions
In your browser's Network tab, right-click a request and choose Copy as cURL.