Copy code from API docs
Most APIs document requests as curl. Paste them here and get Axios or fetch code you can drop straight into a React, Next.js, or Node project. No more hand-translating -H, -d and -F flags.
ToolDeck.online
INITIALIZING_
0%Paste a curl command from any API doc and get clean, working Axios code instantly. One click switches to native fetch. Handles JSON, form data, file uploads, auth, headers, cookies and query params.
Paste a curl command on the left and the axios code will appear here.
Everything runs in your browser. Nothing is sent to a server.
Note: Axios sets Content-Type automatically for objects and FormData. If your curl command set a custom type, it is preserved above.
Most APIs document requests as curl. Paste them here and get Axios or fetch code you can drop straight into a React, Next.js, or Node project. No more hand-translating -H, -d and -F flags.
When a customer files an issue with a curl command, convert it to Axios in one paste. You will see the exact request your app should send, with all headers, params and body fields laid out cleanly.
If you are new to Axios or fetch, paste a curl command you already understand and see how the same request looks in JavaScript. The patterns become obvious after one or two conversions.
Moving from curl scripts to Axios, or from Axios to native fetch? Convert in both directions with one tool, and copy the result without leaving the browser.
Most curl converters either upload your command to a server (bad if you paste a token) or only handle a subset of common flags. This tool parses locally, keeps your secrets private, and covers the flags you actually use in real API docs.
Everything runs in your browser
Your curl command never leaves your device. There is no server, no upload, no log. Paste a token, paste a body, paste a secret header. Nothing is sent anywhere.
Covers the flags people actually use
GET, POST, PUT, PATCH, DELETE, JSON bodies, url-encoded forms, multipart file uploads, basic auth, Bearer tokens, cookies, user agent and referer are all recognised and preserved.
Two outputs, one click
Switch between Axios and native fetch with a single tap. Both are valid, modern JavaScript, ready to paste into any project with no extra dependency for fetch, and a single import line for axios.
Handles tricky input
Multi-line curl commands, single quotes, double quotes, backslash escapes, --header=Key:Value form, --data-urlencode, and -G all parse correctly without manual cleanup.
| Feature | ToolDeck | Other converters |
|---|---|---|
| Runs in browser | Yes, no upload | Uploads curl to a server |
| Axios + fetch output | Both, one click | Often just one |
| File upload support | Yes, with FormData | Partial or none |
| Basic auth | Yes, -u handled | Sometimes ignored |
| Cost | Free, no sign-up | Freemium, limited |
| Privacy | Your tokens never leave | Sent to their server |
Here is the exact mapping the converter uses. If your flag is on the left, it is handled on the right.
| curl flag | Meaning | Becomes |
|---|---|---|
| -X, --request | HTTP method | method: "post" |
| -H, --header | Request header | headers: { "Key": "Value" } |
| -d, --data | Request body | data: { ... } or URLSearchParams |
| -F, --form | Multipart form field | FormData().append(...) |
| -u, --user | Basic auth | auth: { username, password } |
| -b, --cookie | Cookie header | headers: { Cookie: "..." } |
| -A, --user-agent | User agent header | headers: { "User-Agent": "..." } |
| -G, --get | Move body into query | params: new URLSearchParams(...) |
Shell-only syntax like $(command) substitution, environment variables ($API_KEY), pipes, and reading file contents with @file.json cannot run in a browser. Replace shell variables with their values before pasting. For file uploads via -F, the generated code uses File objects that you provide from an <input type="file"> element.
Grab it from API docs, a bug report, or a terminal session. Multi-line commands are fine.
The Axios code appears on the right instantly. Switch to the fetch tab if you prefer native fetch.
One click. The output is ready to use. For uploads, replace the file placeholder with your File object.
No. Everything runs inside your browser using JavaScript. The curl string is parsed locally, converted to code, and displayed. Nothing is sent to a server, so any tokens, cookies or secrets you paste are safe.
The common ones: -X, -H, -d, --data-raw, --data-binary, --data-urlencode, -F, -u, -b, -A, -e, --url, -G, --compressed, -L, -k, -s, -v, and the --flag=value form. Flags that only affect curl output, like -o, --max-time, and --retry, are recognised and safely ignored.
Yes. It generates a FormData block and marks file fields with a comment telling you to replace the placeholder with your File object from an <input type="file"> element. Browser JavaScript cannot read local files from a curl path like @photo.jpg, so the placeholder is required.
fetch is built into every modern browser and Node 18+, so no dependency is needed. It returns a Response you must parse manually. Axios is a small library with a nicer API, automatic JSON parsing, a timeout option, and file upload progress events. Both work well. Pick fetch for zero dependencies, Axios for convenience.
Yes. Use the tabs on the right to switch between the two. The Axios output includes the import line and an await-able call. The fetch output is complete with method, headers, body, and a await response.json() line.
Curl uses @filename to read a file from disk. A browser cannot read files from a path. Instead, the tool outputs form.append("file", file) and adds a comment telling you to supply the File object yourself, typically from a user-picked file in an <input type="file"> element.
It is converted to auth: { username, password } for Axios. For fetch, the tool generates a Basic Authorization header, which is the same thing Axios does under the hood. Both are correct and work against any standard endpoint.
Not in a browser. Things like $(cat token.txt), $API_KEY, and pipes cannot run in JavaScript. If you have shell variables, replace them with their values before pasting.
No. The curl command is a string in memory. It can be a few characters or a few hundred lines, and it converts instantly.
Yes. Completely free. No sign-up, no daily limit, no ads inside the tool, no watermark on the output.