cURL to Fetch Converter
Convert cURL commands to JavaScript fetch API code — or reverse a fetch back to cURL. Supports headers, auth, body, cookies, and common flags.
Parsed components
URLhttps://api.example.com/users
MethodPOST
Headers
Content-Type: application/json
Authorization: Bearer token123
BodyJSON · 47 chars
const response = await fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token123',
},
body: JSON.stringify({
"name": "Alice",
"email": "alice@example.com"
}),
});
const data = await response.json();
console.log(data);