Curl to Fetch
Convert cURL commands into fetch, axios, Python, PHP, Go, or Ruby code.
Free & unlimited
cURL command
POSTOutput
const response = await fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"name\":\"Alice\"}"
});
const data = await response.json();
console.log(data);All processing happens in your browser. No data is sent to any server.
About this tool
- 1
Paste your curl command
Copy a curl command from your terminal, browser DevTools, or API documentation and paste it into the input.
- 2
Review the parsed options
The tool breaks down the curl command showing method, URL, headers, and body.
- 3
Get the JavaScript code
View the equivalent JavaScript fetch() or axios code with all options properly translated.
- 4
Copy and use
Copy the generated JavaScript code into your project.
- Copy curl commands directly from browser DevTools (Network tab > right-click > Copy as cURL) for exact request reproduction.
- The tool handles -H (headers), -d (data), -X (method), -u (auth), and most common curl flags.
- Switch between fetch() and axios output depending on which HTTP library your project uses.
- Multi-line curl commands with backslash continuations are supported - paste them as-is.
- Parses all common curl flags (-H, -d, -X, -u, -F, --data-raw, etc.)
- Generates both fetch() and axios code output
- Handles form data, JSON bodies, and file uploads
- Preserves authentication headers and cookies
- Supports multi-line curl commands with backslash continuations
- Convert API documentation curl examples into JavaScript code for your frontend or Node.js app
- Translate browser DevTools network requests into reusable fetch code
- Generate API client code from curl commands shared by backend developers
- Quickly prototype API integrations by converting curl test commands to JavaScript
Common flags including -X (method), -H (header), -d (data), -u (basic auth), -F (form data), --data-raw, --compressed, -b (cookies), and -k (insecure) are supported.
Yes. Toggle the output format between native fetch(), axios, and even Node.js https module code.
File upload flags (-F, --data-binary @file) are translated to FormData in the JavaScript output with a placeholder for the file reference.