Base Metabolic Rate (BMR) Calculator
Your Base Metabolic Rate (BMR) is the number of calories your body needs to perform basic life-sustaining functions while at rest. This includes breathing, circulation, cell production, and nutrient processing. Several factors influence your BMR, including age, sex, muscle mass, and genetics. Understanding your BMR can help you better manage your calorie intake for weight management and overall health.
Weight (kg):
Height (cm):
Age (years):
Sex:
Male
Female
Calculate BMR
.bmr-calculator {
font-family: sans-serif;
max-width: 500px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.bmr-calculator h2 {
text-align: center;
margin-bottom: 15px;
color: #333;
}
.bmr-calculator p {
margin-bottom: 25px;
line-height: 1.6;
color: #555;
}
.input-section label {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #444;
}
.input-section input[type="number"],
.input-section select {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
.input-section button {
width: 100%;
padding: 12px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
.input-section button:hover {
background-color: #45a049;
}
.result-section {
margin-top: 25px;
padding: 15px;
background-color: #e8f5e9;
border: 1px solid #c8e6c9;
border-radius: 4px;
text-align: center;
font-size: 1.1em;
color: #388e3c;
font-weight: bold;
}
function calculateBMR() {
var weight = parseFloat(document.getElementById("weight").value);
var height = parseFloat(document.getElementById("height").value);
var age = parseFloat(document.getElementById("age").value);
var sex = document.getElementById("sex").value;
var bmrResult = document.getElementById("result");
if (isNaN(weight) || isNaN(height) || isNaN(age) || weight <= 0 || height <= 0 || age <= 0) {
bmrResult.innerHTML = "Please enter valid positive numbers for weight, height, and age.";
return;
}
var bmr = 0;
if (sex === "male") {
// Mifflin-St Jeor Equation for men
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else {
// Mifflin-St Jeor Equation for women
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 161;
}
bmrResult.innerHTML = "Your estimated Base Metabolic Rate is: " + bmr.toFixed(2) + " calories per day.";
}