- Enter your Gender, Date of Birth, Weight (kg), and Height (cm).
- Click "Calculate BMI" to calculate your BMI.
- View the BMI category, color-coded progress bar, and calculation details.
- Your calculation history will be displayed below.
- Click "Clear" to reset the form and calculations.
- Click "Copy" to copy the BMI result to the clipboard.
Gender: Female
'; } result += 'Date of Birth: ' + dob + '
'; if (bmi < 18.5) { result += 'You are underweight.
'; } else if (bmi >= 18.5 && bmi < 24.9) { result += 'You have a normal weight.
'; } else if (bmi >= 25 && bmi < 29.9) { result += 'You are overweight.
'; } else { result += 'You are obese.
'; }// Color-coded BMI categories const progressBar = document.getElementById('progressBar'); let progressBarColor = '';if (bmi < 16) { progressBarColor = 'bg-danger'; } else if (bmi >= 16 && bmi < 18.5) { progressBarColor = 'bg-warning'; } else if (bmi >= 18.5 && bmi < 25) { progressBarColor = 'bg-success'; } else if (bmi >= 25 && bmi < 30) { progressBarColor = 'bg-warning'; } else { progressBarColor = 'bg-danger'; }progressBar.className = 'progress-bar ' + progressBarColor; progressBar.style.width = (bmi < 0 ? 0 : bmi) + '%';// Calculation details details = `Calculation Details:
Weight: ${weight} kg
Height: ${height * 100} cm
BMI Formula: BMI = Weight (kg) / (Height (m) * Height (m))
BMI Calculation: BMI = ${weight} / (${height} * ${height}) = ${bmi}
Age: ${age} years
`;// Store the calculation in history history.push({ date: new Date(), bmi: bmi, details: details }); displayHistory(); } else { result = 'Invalid input. Please enter valid values.
'; }document.getElementById('result').innerHTML = result; document.getElementById('calculationDetails').innerHTML = details; }function calculateAge(birthDate) { const currentDate = new Date(); const yearsDifference = currentDate.getFullYear() - birthDate.getFullYear();if ( currentDate.getMonth() < birthDate.getMonth() || (currentDate.getMonth() === birthDate.getMonth() && currentDate.getDate() < birthDate.getDate()) ) { return yearsDifference - 1; }return yearsDifference; }function displayHistory() { const historyList = document.getElementById('historyList'); historyList.innerHTML = ''; history.forEach((item, index) => { const li = document.createElement('li'); li.innerHTML = `Calculation ${index + 1}:${item.date.toLocaleString()}
${item.details}`; historyList.appendChild(li); }); }
Concepts
Body mass index (BMI) is a measure of body fat based on height and weight that is used to screen for weight categories that may lead to health problems. BMI is calculated by dividing a person’s weight in kilograms (kg) by the square of their height in meters (m).
Formula
The following formula is used to calculate BMI:
BMI = weight (kg) / height^2 (m^2)
Interpretation
A BMI of 18.5 to 24.9 is considered to be a healthy weight. A BMI of 25.0 to 29.9 is considered overweight. A BMI of 30.0 or higher is considered obese.
Benefits
BMI is a simple and inexpensive way to screen for weight categories that may lead to health problems. It can be used by people of all ages and genders.
Interesting facts
- BMI was developed in the late 1800s by a Belgian statistician named Adolphe Quetelet.
- BMI is used in over 100 countries around the world.
- BMI is not a perfect measure of body fatness. It does not take into account muscle mass or body composition.
- BMI is most accurate for adults between the ages of 20 and 65.
Scholarly references
- Clinical Assessment of Nutritional Status by Robert J. Fanelli (2012)
- Obesity and the Body Mass Index: Or Why We Are Still Measuring Abdominal Obesity by Kelly Brownell and Joann E. Manson (2005)
- Body Mass Index and Mortality by Katherine M. Flegal, MD, MPH, and Barry M. Popkin, PhD (2001)
Examples
The following table shows some examples of BMI calculations:
Weight (kg) | Height (m) | BMI |
---|---|---|
60 | 1.6 | 23.4 |
70 | 1.7 | 24.2 |
80 | 1.8 | 25.0 |
Applications
BMI can be used by individuals, healthcare professionals, and public health officials.
- Individuals: Individuals can use BMI to track their weight over time and to assess their risk of developing weight-related health problems.
- Healthcare professionals: Healthcare professionals can use BMI to screen for weight categories that may lead to health problems and to develop treatment plans for obese patients.
- Public health officials: Public health officials can use BMI to track the prevalence of obesity in a population and to develop public health interventions to promote healthy weight.
Conclusion
BMI is a simple and inexpensive tool that can be used to screen for weight categories that may lead to health problems. It is important to note that BMI is not a perfect measure of body fatness and that other factors, such as muscle mass and body composition, should also be considered when assessing a person’s health.