Body Mass Index (BMI) & Basal Metabolic Rate (BMR) Calculator

BMI and BMR Calculator body { font-family: Arial, sans-serif; padding: 20px; background-color: #f4f4f4; } h2 { text-align: center; color: #333; } form { max-width: 90%; margin: 0 auto; margin-bottom: 20px; background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } label { display: block; margin-bottom: 5px; color: #555; } input[type="text"], select { padding: 10px; margin-bottom: 15px; width: 45%; box-sizing: border-box; border: 1px solid #ddd; border-radius: 5px; margin-right: 5%; } input[type="button"] { background-color: #4CAF50; color: white; padding: 12px 20px; border: none; cursor: pointer; width: 100%; border-radius: 5px; } input[type="button"]:hover { background-color: #45a049; } #results { margin-top: 20px; background-color: #fff; border: 4px solid #000; padding: 20px; border-radius: 10px; } #results div { margin-bottom: 10px; } #report { font-weight: bold; text-align: center; color: #333; } .row { display: flex; justify-content: space-between; } /* Additional CSS for responsive design */ @media (max-width: 600px) { .row { flex-direction: column; } input[type="text"], select { width: 100%; margin-right: 0; margin-bottom: 5%; } }

BMI and BMR Calculator

cm inches kg pounds
Male Female
Your BMI is:
Your BMR is:
function calculate() { var height = document.getElementById('height').value; var weight = document.getElementById('weight').value; var heightUnit = document.getElementById('height_unit').value; var weightUnit = document.getElementById('weight_unit').value; var age = parseFloat(document.getElementById('age').value); // Convert height to cm if the input is in inches if (heightUnit === 'inches') { height = height * 2.54; // 1 inch = 2.54 cm } // Convert weight to kg if the input is in pounds if (weightUnit === 'pounds') { weight = weight * 0.453592; // 1 pound = 0.453592 kg } // Perform BMI calculation var bmi = weight / ((height / 100) * (height / 100)); document.getElementById('bmi_result').textContent = bmi.toFixed(2); // Perform BMR calculation var gender = document.getElementById('gender').value; var bmr = 0; if (gender === 'male') { bmr = 88.362 + (13.397 * weight) + (4.799 * height) - (5.677 * age); } else if (gender === 'female') { bmr = 447.593 + (9.247 * weight) + (3.098 * height) - (4.330 * age); } document.getElementById('bmr_result').textContent = bmr.toFixed(2); // Provide the BMI report var report = document.getElementById('report'); if (bmi = 16 && bmi = 18.5 && bmi = 25 && bmi < 30) { report.textContent = "You are slightly overweight. Umm."; } else { report.textContent = "You are severely overweight. Opps!"; } }
Body weight to BMI score