Calculate Running Heart Rate Zones

Running Heart Rate Zones Calculator

Understanding your heart rate zones is crucial for effective training. Different zones correspond to different exercise intensities and physiological benefits. This calculator will help you determine your personal heart rate zones based on your age and a resting heart rate.

function calculateHeartRateZones() { var age = parseFloat(document.getElementById("age").value); var restingHeartRate = parseFloat(document.getElementById("restingHeartRate").value); var resultDiv = document.getElementById("heartRateZonesResult"); resultDiv.innerHTML = ""; // Clear previous results if (isNaN(age) || isNaN(restingHeartRate) || age <= 0 || restingHeartRate 220) { resultDiv.innerHTML = "Please enter valid positive numbers for age and resting heart rate. Resting heart rate should be between 1 and 220 BPM."; return; } // Calculate Maximum Heart Rate (MHR) using the Tanaka formula (208 – 0.7 * age) var maxHeartRate = 208 – (0.7 * age); // Calculate Heart Rate Reserve (HRR) var heartRateReserve = maxHeartRate – restingHeartRate; // Define the percentages for each zone (standard Karvonen method percentages) 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 = "

Your Heart Rate Zones:

"; outputHTML += "Maximum Heart Rate (MHR): " + maxHeartRate.toFixed(1) + " BPM"; outputHTML += "Heart Rate Reserve (HRR): " + heartRateReserve.toFixed(1) + " BPM"; outputHTML += "
    "; for (var zoneName in zones) { var zone = zones[zoneName]; var lowerBound = restingHeartRate + (zone.min * heartRateReserve); var upperBound = restingHeartRate + (zone.max * heartRateReserve); outputHTML += "
  • " + zoneName + ": " + lowerBound.toFixed(0) + " – " + upperBound.toFixed(0) + " BPM
  • "; } outputHTML += "
"; resultDiv.innerHTML = outputHTML; } .heart-rate-zones-calculator { font-family: sans-serif; max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ddd; border-radius: 8px; background-color: #f9f9f9; } .heart-rate-zones-calculator h2 { text-align: center; color: #333; margin-bottom: 20px; } .heart-rate-zones-calculator p { color: #555; line-height: 1.6; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #444; } .form-group input[type="number"] { width: calc(100% – 12px); padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .heart-rate-zones-calculator button { display: block; width: 100%; padding: 10px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; } .heart-rate-zones-calculator button:hover { background-color: #0056b3; } .result { margin-top: 20px; padding: 15px; border: 1px solid #e0e0e0; border-radius: 4px; background-color: #fff; } .result h3 { margin-top: 0; color: #333; } .result ul { list-style: none; padding: 0; } .result li { margin-bottom: 8px; color: #555; } .result strong { color: #007bff; }

Leave a Comment