Understanding your target heart rate zones can significantly improve the effectiveness and safety of your workouts. This calculator helps you estimate your optimal heart rate range for different training intensities, based on your age.
function calculateHeartRate() {
var ageInput = document.getElementById("age");
var resultDiv = document.getElementById("result");
// Clear previous results
resultDiv.innerHTML = "";
// Input validation
if (ageInput.value === "" || isNaN(ageInput.value) || ageInput.value <= 0) {
resultDiv.innerHTML = "Please enter a valid age (a positive number).";
return;
}
var age = parseInt(ageInput.value);
// Maximum Heart Rate (MHR) Estimation using the Tanaka formula (208 – 0.7 * age)
// This is a common and well-regarded formula for estimating MHR.
var maxHeartRate = 208 – (0.7 * age);
// Heart Rate Zones Calculation
// Zone 1: Very Light (50-60% of MHR) – Warm-up, cool-down, recovery
var zone1Min = maxHeartRate * 0.50;
var zone1Max = maxHeartRate * 0.60;
// Zone 2: Light (60-70% of MHR) – Steady-state cardio, endurance
var zone2Min = maxHeartRate * 0.60;
var zone2Max = maxHeartRate * 0.70;
// Zone 3: Moderate (70-80% of MHR) – Aerobic fitness, improved endurance
var zone3Min = maxHeartRate * 0.70;
var zone3Max = maxHeartRate * 0.80;
// Zone 4: Hard (80-90% of MHR) – Anaerobic threshold, improved speed and power
var zone4Min = maxHeartRate * 0.80;
var zone4Max = maxHeartRate * 0.90;
// Zone 5: Maximum (90-100% of MHR) – High-intensity interval training (HIIT), peak performance
var zone5Min = maxHeartRate * 0.90;
var zone5Max = maxHeartRate * 1.00;
// Display Results
resultDiv.innerHTML = `
Your Estimated Heart Rate Zones:
Estimated Maximum Heart Rate (MHR): ${maxHeartRate.toFixed(1)} bpm