cURL Converter
Convert cURL commands to JavaScript fetch or Axios code instantly.
| Flag | Description | Example |
|---|---|---|
| -X | HTTP method | -X POST |
| -H | Add header | -H "Content-Type: application/json" |
| -d / --data | Request body | -d '{"key":"value"}' |
| -u | Basic auth | -u username:password |
| -b | Send cookies | -b "session=abc123" |
| -L | Follow redirects | -L |
| -k | Ignore SSL errors | -k |
| --compressed | Accept encoding | --compressed |
📝 cURL Command
✨ JavaScript fetch()
How to Use
- Paste your cURL command in the left panel
- Choose output format: fetch() or axios
- Click 🔄 Convert to generate JavaScript code
- The converter parses method, URL, headers, body data, and authentication
- Click 📋 Copy to copy the generated code
Why Convert cURL?
cURL is one of the most widely used command-line tools for making HTTP requests. API documentation, Postman exports, and browser DevTools (Copy as cURL) all produce cURL commands. But when building web applications, you need JavaScript. This tool bridges that gap — paste a cURL command and get clean, ready-to-use fetch() or Axios code that you can drop directly into your project.