Resting Metabolic Rate (RMR) Calculator
Resting Metabolic Rate (RMR) is the number of calories your body burns at rest to maintain basic functions like breathing, circulation, and cell production. It's a crucial component of your total daily energy expenditure. This calculator uses the Mifflin-St Jeor equation, considered one of the most accurate for estimating RMR.
Gender:
Male
Female
Weight (kg):
Height (cm):
Age (years):
Calculate RMR
function calculateRMR() {
var gender = document.getElementById("gender").value;
var weightKg = parseFloat(document.getElementById("weightKg").value);
var heightCm = parseFloat(document.getElementById("heightCm").value);
var age = parseInt(document.getElementById("age").value);
var rmr = 0;
if (isNaN(weightKg) || isNaN(heightCm) || isNaN(age) || weightKg <= 0 || heightCm <= 0 || age <= 0) {
document.getElementById("result").innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
if (gender === "male") {
// Mifflin-St Jeor Equation for Men
rmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) + 5;
} else {
// Mifflin-St Jeor Equation for Women
rmr = (10 * weightKg) + (6.25 * heightCm) – (5 * age) – 161;
}
if (rmr < 0) {
rmr = 0; // RMR cannot be negative
}
document.getElementById("result").innerHTML = "Your estimated Resting Metabolic Rate (RMR) is:
" + rmr.toFixed(2) + " calories per day ";
}
.calculator-container {
font-family: sans-serif;
border: 1px solid #ddd;
padding: 20px;
border-radius: 8px;
max-width: 500px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-container h2 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.inputs {
margin-bottom: 20px;
}
.inputs label {
display: inline-block;
width: 120px;
margin-bottom: 10px;
font-weight: bold;
color: #555;
}
.inputs input[type="number"],
.inputs select {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
width: calc(100% – 140px);
box-sizing: border-box;
}
.inputs button {
display: block;
width: 100%;
padding: 10px 15px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.inputs button:hover {
background-color: #45a049;
}
.result {
text-align: center;
margin-top: 20px;
font-size: 18px;
color: #333;
padding: 10px;
background-color: #e8f5e9;
border: 1px solid #c8e6c9;
border-radius: 4px;
}