cURL to Axios
Paste any curl command and get ready-to-run Axios code — async/await, promise chain, or config-only.
About cURL to Axios Converter
This tool converts any curl command into equivalent Axios code. Pick from three output styles: async/await for most modern codebases, promise chains for older promise-based flows, or a config-only output when you want to drop the request into an existing Axios instance.
Everything runs 100% in your browser. Your curl commands, tokens, cookies, and request bodies never leave your device. The parser handles multi-line commands, headers, JSON bodies, basic auth, form fields, cookies, referer, user-agent, and common curl flags.
How to Use
- Paste your curl command on the left, or click Load Sample.
- Choose an output style for your project.
- Pick the return mode — just
response.dataor the full Axios response object. - Copy the generated code and paste it into your JavaScript or TypeScript file.
Supported curl Flags
Request
-X / --request— HTTP method-H / --header— request headers-d / --data / --data-raw— body-F / --form— FormData-G / --get— force GET-I / --head— HEAD request
Options
-u / --user— Axiosauth-A / --user-agent-e / --referer-b / --cookie— cookie header +withCredentials-L / --location— follows redirects-k / --insecure— comment added for Node.js-only mapping--compressed
Common Use Cases
- API docs to app code: Paste a curl example from Stripe, OpenAI, GitHub, or any REST API docs and get Axios code instantly.
- Node.js scripts: Quickly turn copied curl commands into reusable Axios requests for scripts, jobs, and server routes.
- Frontend debugging: Copy as cURL from DevTools, convert it, and reproduce the request in your React, Vue, or Svelte app.
- Migration work: Replace old fetch or raw HTTP snippets with a cleaner Axios config object.
Frequently Asked Questions
Does this work for browser and Node.js Axios?
Yes. The generated code is plain Axios. A few options behave differently by runtime — for example redirect and TLS settings are mostly Node.js concerns — but the base request structure works in both environments.
How is basic auth handled?
If your curl command uses -u user:pass, the converter maps it to Axios auth unless you already set an Authorization header manually.
Does it support multi-line curl commands?
Yes. Backslash + newline continuations are joined before parsing, so you can paste curl commands exactly as copied from docs or DevTools.
Are my tokens or cookies uploaded anywhere?
No. Parsing and code generation happen entirely in your browser. Nothing is sent to a server.
What about -k / --insecure?
Browsers do not let JavaScript bypass TLS verification. The converter leaves a note in the output because the equivalent Axios workaround only exists in Node.js via a custom HTTPS agent, and that should be used only for local development.