This calculator estimates the number of calories you burn during an exercise session based on your heart rate, weight, age, gender, and the duration of your activity. Your heart rate is a key indicator of exercise intensity. Higher heart rates generally correspond to a greater calorie expenditure because your body is working harder to meet the increased demand for oxygen and energy.
The estimation uses a common formula that considers your Basal Metabolic Rate (BMR), which is influenced by your weight, age, and gender, and then factors in the intensity of your workout (indicated by heart rate and duration). While this provides a good estimate, individual metabolic rates can vary. For precise measurements, consider using a heart rate monitor that offers more advanced calorie tracking or consult with a fitness professional.
How to use:
Enter your current weight in kilograms.
Enter your age in years.
Input your average heart rate in beats per minute (bpm) during the exercise.
Specify the total duration of your exercise in minutes.
Select your gender.
Click "Calculate Calories Burned".
function calculateCalories() {
var weight = parseFloat(document.getElementById("weight").value);
var age = parseInt(document.getElementById("age").value);
var heartRate = parseInt(document.getElementById("heartRate").value);
var duration = parseInt(document.getElementById("duration").value);
var gender = document.getElementById("gender").value;
var resultDiv = document.getElementById("result");
if (isNaN(weight) || isNaN(age) || isNaN(heartRate) || isNaN(duration) || weight <= 0 || age < 0 || heartRate < 0 || duration < 0) {
resultDiv.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Simplified MET estimation based on heart rate zones (very rough approximation)
// These are general ranges and can vary significantly by individual fitness level.
var metValue = 0;
var maxHeartRate = 220 – age; // Approximate maximum heart rate
if (heartRate < (maxHeartRate * 0.5)) {
metValue = 4.0; // Light intensity
} else if (heartRate < (maxHeartRate * 0.7)) {
metValue = 7.0; // Moderate intensity
} else if (heartRate < (maxHeartRate * 0.85)) {
metValue = 9.0; // Vigorous intensity
} else {
metValue = 11.0; // Very vigorous intensity
}
// Calories Burned per Minute = (MET * 3.5 * weight_kg) / 200
var caloriesPerMinute = (metValue * 3.5 * weight) / 200;
var totalCaloriesBurned = caloriesPerMinute * duration;
// Adjustments for gender (slight difference, can be more complex)
if (gender === "female") {
totalCaloriesBurned *= 0.9; // Females generally burn slightly fewer calories for the same MET and weight
}
resultDiv.innerHTML = "You have burned approximately " + totalCaloriesBurned.toFixed(2) + " calories.";
}