cURL to Fetch / Axios
Convert cURL commands into JavaScript fetch, Axios or Python requests code, with headers, body, auth and method handled.
No uploads
const res = await fetch('https://api.example.com/v1/users?team=core', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer TOKEN'
},
body: JSON.stringify({
"name": "Ada",
"role": "admin"
})
});
const data = await res.json();
console.log(data); How to use cURL to Fetch / Axios
- 1Open cURL to Fetch / Axios. It runs in your browser, no sign-up.
- 2Type or paste your input.
- 3Copy or download the result.
Questions
Which curl options are supported?
Method (-X), headers (-H), data (-d, --data-raw, --data-urlencode, --json), basic auth (-u), forms (-F), cookies (-b), user agent (-A), -G and -I. Cosmetic flags like -s, -L and --compressed are ignored.
Can I paste a command from Chrome DevTools?
Yes — “Copy as cURL (bash)” output works, including multi-line commands with backslashes.
Are my tokens safe?
Yes. Conversion happens in your browser; nothing is sent anywhere.
More tools
JSON Formatter & ValidatorPretty-print, minify, validate Base64 Encoder & DecoderText and files Hash GeneratorMD5, SHA-1, SHA-256, SHA-512 Password & UUID GeneratorStrong, random, local Regex TesterLive matches and groups JWT DecoderHeader, payload, expiry Diff CheckerCompare two texts CSV ↔ JSON ↔ YAML ↔ XMLConvert data formats