Calculate My Basal Metabolic Rate

Basal Metabolic Rate (BMR) 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. It's essentially the minimum energy expenditure required to keep your body alive and functioning.

Understanding your BMR can be a foundational step in managing your weight, as it helps you determine how many calories you need to consume to maintain, lose, or gain weight. Your BMR is influenced by several factors including age, sex, weight, and height.

Male Female
function calculateBMR() { var gender = document.getElementById("gender").value; var weightKg = document.getElementById("weightKg").value; var heightCm = document.getElementById("heightCm").value; var age = document.getElementById("age").value; var weight = parseFloat(weightKg); var height = parseFloat(heightCm); var userAge = parseInt(age); var bmr = 0; if (isNaN(weight) || isNaN(height) || isNaN(userAge) || weight <= 0 || height <= 0 || userAge <= 0) { document.getElementById("bmrResult").innerHTML = "Please enter valid numbers for all fields."; return; } if (gender === "male") { // Mifflin-St Jeor Equation for Men bmr = (10 * weight) + (6.25 * height) – (5 * userAge) + 5; } else { // Mifflin-St Jeor Equation for Women bmr = (10 * weight) + (6.25 * height) – (5 * userAge) – 161; } document.getElementById("bmrResult").innerHTML = "

Your Estimated Basal Metabolic Rate (BMR):

" + bmr.toFixed(2) + " calories per day"; } #bmr-calculator { font-family: sans-serif; max-width: 500px; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 8px; background-color: #f9f9f9; } #bmr-calculator h2, #bmr-calculator h3 { text-align: center; color: #333; } .input-section { margin-bottom: 15px; } .input-section label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; } .input-section input[type="number"], .input-section select { width: calc(100% – 12px); padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; /* Include padding and border in the element's total width and height */ } #bmr-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; } #bmr-calculator button:hover { background-color: #0056b3; } #bmrResult { margin-top: 20px; padding: 15px; border-top: 1px solid #eee; text-align: center; background-color: #fff; border-radius: 4px; } #bmrResult p { font-size: 1.1em; color: #333; }

Leave a Comment