cURL to Axios Converter

Turn cURL commands into Axios request configs with headers, data, auth and error handling.

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.

Axios request

  

About this tool

Axios remains the go-to HTTP client for many JavaScript and Node projects. This converter parses your cURL command and produces a complete axios(config) call — method, URL, headers, JSON or form data, and basic-auth credentials mapped to Axios's auth option.

Includes the import line and try/catch or .then/.catch scaffolding, ready to run.

How to use it

  1. Paste a cURL command from any documentation.
  2. Choose async/await style and whether to include the import.
  3. Copy the generated Axios code.
  4. Adjust variable names to taste — the request logic is complete.

Useful ways to apply it

  • Porting API examples into an existing Axios codebase.
  • Converting Postman-exported cURL into Node.js scripts.
  • Standardizing team snippets on one HTTP client.
  • Comparing fetch vs Axios shapes for the same request.

Frequently asked questions

How is basic auth handled?
-u user:pass becomes the Axios auth: { username, password } option rather than a manual header.
Does it output error handling?
Yes — try/catch (async mode) or .catch, both reading error.response.data when available.
Form data support?
-F fields generate FormData code and pass it as data, letting Axios set the multipart boundary automatically.

Privacy

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.