cURL to Axios
Convert cURL commands to Axios request code. Handles methods, headers, authentication, JSON bodies, and form data.
Processed locally in your browser — nothing is uploaded.
cURL to Axios
0 characters
Axios request
Output appears here…About cURL to Axios
Convert any cURL command into an Axios call. The generated code uses the axios(config) form with method, url, headers, params, and data so it stays readable for complex requests.
Common uses
- Convert API docs written for the terminal into Node.js or browser code
- Move quick cURL experiments into an existing Axios codebase
Example
Input
curl https://api.example.com/search?q=test -H 'Authorization: Bearer TOKEN'
Output
const response = await axios({
method: "GET",
url: "https://api.example.com/search",
params: { q: "test" },
headers: {
Authorization: "Bearer TOKEN",
},
});Limitations
- cURL options without an Axios equivalent are reported but skipped
Frequently asked questions
Does converting a cURL command here upload it anywhere?
No. The command is parsed and converted with JavaScript running on your device, and nothing is sent to any server — so bearer tokens, cookies, and credentials in the command stay with you.
Why does the generated code use a params object instead of a query string?
Query parameters are split out of the URL into Axios's params config, which is the idiomatic Axios style: Axios serializes and encodes them for you, and each parameter stays readable and editable as its own key.
How is cURL basic auth (-u user:pass) converted?
The username and password are Base64-encoded and emitted as an Authorization: Basic header in the generated config, which sends the same bytes curl would send.
Can I use the generated Axios code in Node.js?
Yes. The axios(config) call works the same in Node and the browser, and the output includes the import line. Multipart conversions use FormData, which is global in Node 18+; older Node versions need the form-data package.
What happens to cURL flags Axios has no equivalent for?
They are reported as warnings and skipped rather than aborting the conversion — for example --insecure, --proxy, and --cacert can't be expressed in browser-side Axios code.