Skip to content
migration.tools
curl to Axios

Curl to Axios converter

Convert a curl command into an axios() call with a single config object — method, URL, headers, data, auth and timeout — ready to drop into a Node.js service or front-end code.

curl command

Axios

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Paste your curl or drop a file onto the input panel.
  2. 2Adjust the options — the result updates as you type.
  3. 3Copy the Axios or download it. Drop several files to convert a batch into one ZIP.

What is understood

Method (-X), headers (-H), JSON and form bodies (-d, --data-raw, --data-urlencode, --json), multipart uploads (-F), basic auth (-u), cookies (-b), user agent, referer, bearer tokens, -G query strings, timeouts and redirects.

The command is split the way a shell would, including single and double quotes, backslash line continuations and the $'…' quoting that Chrome and Firefox produce when you copy a request as cURL.

When the body is JSON, it is emitted as a native object rather than an escaped string, so you can edit it straight away.

Questions

How do I copy a request from my browser as curl?

Open DevTools → Network, right-click the request and choose Copy → Copy as cURL. Paste it here. Remove cookies and tokens you don't want in your code first.

Is the command — including my tokens — sent to a server?

No. The command is parsed in your browser. Nothing is transmitted and the request itself is never executed.