9 Interest Rate Calculator

BMI Calculator

Calculate your Body Mass Index (BMI) to understand your weight category. BMI is a measure of body fat based on height and weight that applies to adult men and women.

Your BMI will appear here.

Understanding Your BMI

Body Mass Index (BMI) is a simple calculation using a person's height and weight. The formula is:

BMI = weight (kg) / [height (m)]2

It's a useful screening tool, but it doesn't diagnose the body fatness or health of an individual.

BMI Categories:

  • Underweight: BMI less than 18.5
  • Normal weight: BMI from 18.5 to 24.9
  • Overweight: BMI from 25 to 29.9
  • Obesity: BMI 30 or greater

Consult with a healthcare professional for a more accurate assessment of your health status.

function calculateBMI() { var weight = document.getElementById("weight").value; var height = document.getElementById("height").value; var resultDiv = document.getElementById("result"); // Validate inputs if (isNaN(weight) || weight <= 0) { resultDiv.innerHTML = "Please enter a valid weight in kilograms."; return; } if (isNaN(height) || height <= 0) { resultDiv.innerHTML = "Please enter a valid height in meters."; return; } var bmi = weight / (height * height); var bmiCategory = ""; if (bmi = 18.5 && bmi = 25 && bmi <= 29.9) { bmiCategory = "Overweight"; } else { bmiCategory = "Obesity"; } resultDiv.innerHTML = "Your BMI is: " + bmi.toFixed(2) + " (" + bmiCategory + ")"; } #bmi-calculator-widget { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 5px; max-width: 500px; margin: 20px auto; background-color: #f9f9f9; } #bmi-calculator-widget h2 { text-align: center; color: #333; margin-bottom: 15px; } .input-group { margin-bottom: 15px; } .input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; } .input-group input[type="number"] { width: calc(100% – 12px); padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } #bmi-calculator-widget button { display: block; width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; margin-bottom: 15px; } #bmi-calculator-widget button:hover { background-color: #45a049; } #result { margin-top: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; background-color: #fff; text-align: center; font-size: 1.1em; color: #333; } .explanation { margin-top: 25px; border-top: 1px solid #eee; padding-top: 15px; font-size: 0.9em; color: #666; } .explanation h3, .explanation h4 { color: #444; margin-bottom: 8px; } .explanation ul { list-style: disc; margin-left: 20px; padding-left: 0; }

Leave a Comment