Calculate Max Heart Rate Cycling

Maximum Heart Rate Calculator for Cycling

Your maximum heart rate (MHR) is the highest number of times your heart can beat per minute during maximal physical exertion. It's a crucial metric for cyclists to understand their training zones. A common and widely used formula to estimate MHR is the Tanaka formula, which is considered more accurate than the older "220 minus age" method for a broader range of individuals.

function calculateMaxHeartRate() { var ageInput = document.getElementById("age"); var resultDiv = document.getElementById("result"); var age = parseFloat(ageInput.value); if (isNaN(age) || age = 120) { resultDiv.innerHTML = "Please enter a valid age between 1 and 120."; return; } // Tanaka formula: MHR = 208 – (0.7 * Age) var maxHeartRate = 208 – (0.7 * age); resultDiv.innerHTML = "

Your Estimated Maximum Heart Rate:

" + maxHeartRate.toFixed(0) + " bpm"; } .heart-rate-calculator { font-family: Arial, sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 400px; margin: 20px auto; background-color: #f9f9f9; } .heart-rate-calculator h2 { text-align: center; color: #333; margin-bottom: 15px; } .heart-rate-calculator p { color: #555; line-height: 1.6; margin-bottom: 20px; } .input-section { margin-bottom: 15px; } .input-section label { display: block; margin-bottom: 5px; color: #333; font-weight: bold; } .input-section input[type="number"] { width: calc(100% – 22px); padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .heart-rate-calculator button { display: block; width: 100%; padding: 12px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; } .heart-rate-calculator button:hover { background-color: #45a049; } .result-section { margin-top: 20px; text-align: center; background-color: #e8f5e9; padding: 15px; border: 1px solid #c8e6c9; border-radius: 4px; } .result-section h3 { color: #2e7d32; margin-bottom: 10px; } .result-section p { font-size: 1.2em; color: #1b5e20; font-weight: bold; }

Leave a Comment