Metabolic Caloric Rate Calculator

Metabolic Caloric Rate Calculator

Your Basal Metabolic Rate (BMR) is the number of calories your body needs to perform basic life-sustaining functions, such as breathing, circulation, and cell production, at rest. This calculator helps you estimate your BMR using the Mifflin-St Jeor equation, which is widely considered one of the most accurate BMR formulas. Knowing your BMR is a crucial first step in understanding your daily caloric needs for weight management and overall health.

Male Female
function calculateBMR() { var gender = document.getElementById("gender").value; var weightKg = parseFloat(document.getElementById("weightKg").value); var heightCm = parseFloat(document.getElementById("heightCm").value); var ageYears = parseFloat(document.getElementById("ageYears").value); var bmr = 0; // Validate inputs if (isNaN(weightKg) || weightKg <= 0) { document.getElementById("result").innerHTML = "Please enter a valid weight in kilograms."; return; } if (isNaN(heightCm) || heightCm <= 0) { document.getElementById("result").innerHTML = "Please enter a valid height in centimeters."; return; } if (isNaN(ageYears) || ageYears <= 0) { document.getElementById("result").innerHTML = "Please enter a valid age in years."; return; } // Mifflin-St Jeor Equation if (gender === "male") { bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * ageYears) + 5; } else { // female bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * ageYears) – 161; } document.getElementById("result").innerHTML = "Your estimated Basal Metabolic Rate (BMR) is: " + bmr.toFixed(2) + " calories per day."; } .calculator-container { font-family: Arial, sans-serif; max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .calculator-title { text-align: center; color: #333; margin-bottom: 15px; } .calculator-description { color: #555; line-height: 1.6; margin-bottom: 20px; } .calculator-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; } .input-group { display: flex; flex-direction: column; } .input-group label { margin-bottom: 5px; font-weight: bold; color: #444; } .input-group input[type="number"], .input-group select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; } .calculator-button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 1.1em; cursor: pointer; transition: background-color 0.3s ease; } .calculator-button:hover { background-color: #0056b3; } .calculator-result { margin-top: 25px; padding: 15px; background-color: #e9ecef; border: 1px solid #ced4da; border-radius: 4px; text-align: center; font-size: 1.1em; color: #333; }

Leave a Comment