Your Basal Metabolic Rate (BMR) is the number of calories your body needs to perform basic life-sustaining functions while at rest. These functions include breathing, circulating blood, regulating body temperature, and cell production. Knowing your BMR can help you understand your daily caloric needs and manage your weight more effectively.
Male
Female
Your Estimated Basal Metabolic Rate (BMR):
function calculateBMR() {
var gender = document.getElementById("gender").value;
var weightKg = parseFloat(document.getElementById("weightKg").value);
var heightCm = parseFloat(document.getElementById("heightCm").value);
var age = parseFloat(document.getElementById("age").value);
var bmr = 0;
var bmrResultElement = document.getElementById("bmrResult");
var bmrExplanationElement = document.getElementById("bmrExplanation");
// Clear previous results
bmrResultElement.innerHTML = "";
bmrExplanationElement.innerHTML = "";
// Input validation
if (isNaN(weightKg) || isNaN(heightCm) || isNaN(age) || weightKg <= 0 || heightCm <= 0 || age <= 0) {
bmrResultElement.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
// Mifflin-St Jeor Equation (most commonly used and accurate)
if (gender === "male") {
bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) + 5;
} else { // female
bmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) – 161;
}
bmrResultElement.innerHTML = bmr.toFixed(2) + " calories per day";
bmrExplanationElement.innerHTML = "This is the estimated number of calories your body burns at rest to maintain vital functions. Your total daily energy expenditure (TDEE) will be higher as it also accounts for physical activity.";
}
.calculator-container {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.calculator-container h2, .calculator-container 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;
}
.calculator-container 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;
}
.calculator-container button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #eee;
text-align: center;
}
#bmrResult {
font-size: 1.2em;
font-weight: bold;
color: #28a745;
margin-bottom: 10px;
}
#bmrExplanation {
font-size: 0.9em;
color: #666;
line-height: 1.5;
}