Basal Metabolic Rate (BMR) Calculator
Basal Metabolic Rate (BMR) is the number of calories your body needs to perform basic, life-sustaining functions at rest. This includes breathing, circulating blood, maintaining body temperature, and cell production. Understanding your BMR is a crucial first step in managing your weight and overall health, as it represents the minimum energy your body requires daily. Factors such as age, sex, weight, height, and muscle mass influence your BMR. This calculator uses the Mifflin-St Jeor equation, which is widely considered one of the most accurate formulas for estimating BMR.
Gender:
Male
Female
Weight (kg):
Height (cm):
Age (years):
Calculate BMR
function calculateBMR() {
var gender = document.getElementById("gender").value;
var weight = parseFloat(document.getElementById("weight").value);
var height = parseFloat(document.getElementById("height").value);
var age = parseFloat(document.getElementById("age").value);
var bmr = 0;
if (isNaN(weight) || isNaN(height) || isNaN(age) || weight <= 0 || height <= 0 || age <= 0) {
document.getElementById("result").innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
if (gender === "male") {
bmr = (10 * weight) + (6.25 * height) – (5 * age) + 5;
} else { // female
bmr = (10 * weight) + (6.25 * height) – (5 * age) – 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;
background-color: #f9f9f9;
box-shadow: 0 2px 5px 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: 25px;
text-align: justify;
}
.input-section {
margin-bottom: 15px;
display: flex;
align-items: center;
}
.input-section label {
display: inline-block;
width: 120px;
margin-right: 15px;
font-weight: bold;
color: #444;
}
.input-section input[type="number"],
.input-section select {
flex-grow: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
.calculate-button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.calculate-button:hover {
background-color: #0056b3;
}
.result-section {
margin-top: 25px;
padding: 15px;
border: 1px solid #e0e0e0;
border-radius: 4px;
background-color: #eef7ff;
text-align: center;
font-size: 18px;
color: #333;
}
.result-section strong {
color: #007bff;
}