Understanding your heart rate zones is crucial for optimizing your workouts. Different zones correspond to different intensities and physiological benefits, from fat burning to improving aerobic capacity and building speed.
If you leave this blank, the calculator will estimate it using the common formula (220 – age).
function calculateHeartRateZones() {
var ageInput = document.getElementById("age");
var maxHeartRateInput = document.getElementById("maxHeartRate");
var resultDiv = document.getElementById("result");
var age = parseFloat(ageInput.value);
var maxHeartRate = parseFloat(maxHeartRateInput.value);
if (isNaN(age) || age = 120) {
resultDiv.innerHTML = "Please enter a valid age.";
return;
}
if (isNaN(maxHeartRate) || maxHeartRate = 250) {
// Estimate max heart rate if input is invalid or empty
maxHeartRate = 220 – age;
if (maxHeartRate <= 0) {
resultDiv.innerHTML = "Could not estimate Max Heart Rate from age. Please enter it manually.";
return;
}
}
// Define heart rate zones as percentages of Max Heart Rate
var zones = {
"Zone 1 (Very Light)": { min: 0.50, max: 0.60 },
"Zone 2 (Light)": { min: 0.60, max: 0.70 },
"Zone 3 (Moderate)": { min: 0.70, max: 0.80 },
"Zone 4 (Hard)": { min: 0.80, max: 0.90 },
"Zone 5 (Maximum)": { min: 0.90, max: 1.00 }
};
var outputHTML = "