Heart Rate Zone Calculator
body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; }
.calculator-container { border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 600px; margin: auto; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input[type="number"] { width: calc(100% – 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; }
button { background-color: #4CAF50; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
button:hover { background-color: #45a049; }
#results { margin-top: 20px; padding: 15px; background-color: #f9f9f9; border: 1px solid #eee; border-radius: 4px; }
.zone { margin-bottom: 10px; }
.zone-label { font-weight: bold; }
Heart Rate Zone Calculator
Understanding your heart rate zones is crucial for optimizing your training, whether you're an athlete or just looking to improve your cardiovascular health. These zones help you train at the right intensity to achieve specific goals, from fat burning to endurance building.
This calculator uses the Karvonen formula, which is more personalized than the simpler maximum heart rate (MHR) methods because it takes your resting heart rate (RHR) into account. The formula is:
Target Heart Rate = ((Max Heart Rate – Resting Heart Rate) * %Intensity) + Resting Heart Rate
We will first estimate your Maximum Heart Rate (MHR) using the common formula: MHR = 220 – Age .
Your Age:
Resting Heart Rate (bpm):
Calculate Zones
function calculateHeartRateZones() {
var age = parseInt(document.getElementById("age").value);
var restingHeartRate = parseInt(document.getElementById("restingHeartRate").value);
var resultsDiv = document.getElementById("results");
resultsDiv.innerHTML = "; // Clear previous results
if (isNaN(age) || isNaN(restingHeartRate) || age <= 0 || restingHeartRate <= 0) {
resultsDiv.innerHTML = "Please enter valid positive numbers for age and resting heart rate.";
return;
}
// 1. Estimate Maximum Heart Rate (MHR)
var maxHeartRate = 220 – age;
// 2. Calculate Heart Rate Reserve (HRR)
var heartRateReserve = maxHeartRate – restingHeartRate;
// Define intensity percentages for each zone
var zones = {
"Zone 1 (Very Light)": 0.50, // 50-60% of HRR
"Zone 2 (Light)": 0.60, // 60-70% of HRR
"Zone 3 (Moderate)": 0.70, // 70-80% of HRR
"Zone 4 (Hard)": 0.80, // 80-90% of HRR
"Zone 5 (Maximum)": 0.90 // 90-100% of HRR
};
var outputHTML = "
Your Heart Rate Zones ";
outputHTML += "Estimated Maximum Heart Rate: " + maxHeartRate + " bpm";
outputHTML += "Heart Rate Reserve: " + heartRateReserve + " bpm";
for (var zoneName in zones) {
var lowerIntensity = zones[zoneName];
var upperIntensity = zones[zoneName] + 0.10; // Each zone typically covers a 10% range
var lowerBound = Math.round(((heartRateReserve) * lowerIntensity) + restingHeartRate);
var upperBound = Math.round(((heartRateReserve) * upperIntensity) + restingHeartRate);
// Ensure upper bound doesn't exceed MHR and lower bound is not less than RHR
upperBound = Math.min(upperBound, maxHeartRate);
lowerBound = Math.max(lowerBound, restingHeartRate);
outputHTML += "
";
outputHTML += "" + zoneName + ": ";
outputHTML += lowerBound + " – " + upperBound + " bpm";
outputHTML += "
";
}
resultsDiv.innerHTML = outputHTML;
}