5 Heart Rate Zones Calculator

5 Heart Rate Zones Calculator

This calculator helps you determine your five distinct heart rate training zones, based on your maximum heart rate. Understanding these zones is crucial for effective and safe exercise programming, whether you're aiming for endurance, fat burning, or peak performance.

.heart-rate-zones-calculator { font-family: sans-serif; max-width: 500px; 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; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; } .form-group input { width: calc(100% – 22px); padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .heart-rate-zones-calculator button { width: 100%; padding: 12px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; margin-top: 10px; } .heart-rate-zones-calculator button:hover { background-color: #45a049; } .results-container { margin-top: 25px; padding-top: 15px; border-top: 1px solid #eee; } .zone { margin-bottom: 10px; padding: 10px; background-color: #e7f3e7; border-left: 5px solid #4CAF50; border-radius: 4px; } .zone h3 { margin-top: 0; margin-bottom: 5px; color: #333; } .zone p { margin: 0; color: #666; } .zone strong { color: #333; } function calculateHeartRateZones() { var age = parseInt(document.getElementById("age").value); var restingHeartRate = parseInt(document.getElementById("restingHeartRate").value); if (isNaN(age) || age <= 0) { document.getElementById("results").innerHTML = "Please enter a valid age."; return; } if (isNaN(restingHeartRate) || restingHeartRate <= 0) { document.getElementById("results").innerHTML = "Please enter a valid resting heart rate."; return; } // Karvonen Formula for Heart Rate Reserve (HRR) // HRR = Maximum Heart Rate – Resting Heart Rate // Target Heart Rate = (HRR * % intensity) + Resting Heart Rate // Calculate Max Heart Rate (Fox Formula – common approximation) var maxHeartRate = 220 – age; // Calculate Heart Rate Reserve var heartRateReserve = maxHeartRate – restingHeartRate; var zones = {}; // Zone 1: Very Light (50-60% of Max HR) zones[1] = { name: "Zone 1: Very Light", percentage: "50-60%", lowerBound: Math.round(maxHeartRate * 0.50), upperBound: Math.round(maxHeartRate * 0.60), description: "Good for recovery and warm-ups. Low intensity." }; // Zone 2: Light (60-70% of Max HR) – Fat Burning Zone zones[2] = { name: "Zone 2: Light", percentage: "60-70%", lowerBound: Math.round(maxHeartRate * 0.60), upperBound: Math.round(maxHeartRate * 0.70), description: "Excellent for building aerobic fitness and burning fat. Sustainable for longer durations." }; // Zone 3: Moderate (70-80% of Max HR) – Aerobic Zone zones[3] = { name: "Zone 3: Moderate", percentage: "70-80%", lowerBound: Math.round(maxHeartRate * 0.70), upperBound: Math.round(maxHeartRate * 0.80), description: "Improves aerobic capacity and endurance. Builds muscle strength." }; // Zone 4: Hard (80-90% of Max HR) – Threshold Zone zones[4] = { name: "Zone 4: Hard", percentage: "80-90%", lowerBound: Math.round(maxHeartRate * 0.80), upperBound: Math.round(maxHeartRate * 0.90), description: "Increases lactate threshold and improves speed. Challenging but sustainable for shorter periods." }; // Zone 5: Maximum (90-100% of Max HR) – Max Effort Zone zones[5] = { name: "Zone 5: Maximum", percentage: "90-100%", lowerBound: Math.round(maxHeartRate * 0.90), upperBound: maxHeartRate, description: "Very high intensity, pushes your limits. Improves speed and power. Only for short bursts." }; var resultsHtml = "

Your Heart Rate Zones:

"; resultsHtml += "Based on your age (" + age + ") and resting heart rate (" + restingHeartRate + " BPM), your estimated maximum heart rate is " + maxHeartRate + " BPM."; for (var i = 1; i <= 5; i++) { resultsHtml += "
"; resultsHtml += "

" + zones[i].name + " (" + zones[i].percentage + " of Max HR)

"; resultsHtml += "Range: " + zones[i].lowerBound + " – " + zones[i].upperBound + " BPM"; resultsHtml += "Description: " + zones[i].description + ""; resultsHtml += "
"; } document.getElementById("results").innerHTML = resultsHtml; }

Leave a Comment