body {
font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif;
background-color: #f8f9fa;
color: #333;
line-height: 1.6;
margin: 0;
padding: 0;
}
.container {
max-width: 1000px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
}
header {
text-align: center;
padding: 20px 0;
border-bottom: 1px solid #eee;
margin-bottom: 20px;
}
h1 {
color: #004a99;
margin-bottom: 10px;
}
.calculator-section {
display: flex;
flex-direction: column;
gap: 25px;
}
.loan-calc-container {
background-color: #eef5fb;
padding: 30px;
border-radius: 8px;
border: 1px solid #cce0f7;
display: flex;
flex-direction: column;
gap: 20px;
}
.input-group {
display: flex;
flex-direction: column;
gap: 5px;
}
.input-group label {
font-weight: bold;
color: #004a99;
}
.input-group input[type=”number”],
.input-group select {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
width: calc(100% – 22px); /* Adjust for padding and border */
}
.input-group .helper-text {
font-size: 0.85rem;
color: #555;
}
.error-message {
color: #dc3545;
font-size: 0.85rem;
min-height: 1.2rem; /* Reserve space for error message */
}
.button-group {
display: flex;
gap: 10px;
margin-top: 15px;
justify-content: center;
}
.button-group button {
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
font-weight: bold;
transition: background-color 0.3s ease;
}
.btn-calculate {
background-color: #004a99;
color: white;
}
.btn-calculate:hover {
background-color: #003366;
}
.btn-reset {
background-color: #6c757d;
color: white;
}
.btn-reset:hover {
background-color: #5a6268;
}
.btn-copy {
background-color: #28a745;
color: white;
}
.btn-copy:hover {
background-color: #218838;
}
#results {
margin-top: 30px;
padding: 25px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f0f9ff;
display: flex;
flex-direction: column;
gap: 15px;
text-align: center;
}
#results h3 {
color: #004a99;
margin-bottom: 10px;
}
.bmi-result-main {
font-size: 2.5rem;
font-weight: bold;
color: #28a745;
background-color: #d4edda;
padding: 15px;
border-radius: 5px;
margin-bottom: 15px;
}
.bmi-result-category {
font-size: 1.2rem;
color: #004a99;
margin-bottom: 15px;
}
.intermediate-results div {
font-size: 1.1rem;
margin-bottom: 8px;
color: #333;
}
.formula-explanation {
font-size: 0.9rem;
color: #666;
margin-top: 10px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
padding: 10px;
text-align: left;
border: 1px solid #ddd;
}
thead {
background-color: #004a99;
color: white;
}
tbody tr:nth-child(even) {
background-color: #f2f8ff;
}
caption {
caption-side: top;
font-weight: bold;
font-size: 1.1rem;
color: #004a99;
margin-bottom: 10px;
text-align: left;
}
.chart-container {
margin-top: 30px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f0f9ff;
}
.chart-container h3 {
text-align: center;
color: #004a99;
margin-bottom: 20px;
}
canvas {
display: block;
margin: 0 auto;
}
.article-section {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.article-section h2 {
color: #004a99;
margin-bottom: 15px;
}
.article-section h3 {
color: #0056b3;
margin-top: 20px;
margin-bottom: 10px;
}
.article-section p, .article-section ul {
margin-bottom: 15px;
}
.article-section ul {
padding-left: 20px;
}
.article-section li {
margin-bottom: 8px;
}
.faq-item {
margin-bottom: 15px;
}
.faq-item strong {
color: #004a99;
display: block;
margin-bottom: 5px;
}
.related-tools {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.related-tools h2 {
color: #004a99;
margin-bottom: 15px;
}
.related-tools ul {
list-style: none;
padding: 0;
}
.related-tools li {
margin-bottom: 10px;
}
.related-tools a {
color: #004a99;
text-decoration: none;
font-weight: bold;
}
.related-tools a:hover {
text-decoration: underline;
}
.related-tools p {
font-size: 0.9rem;
color: #555;
margin-top: 5px;
}
.highlight {
background-color: #fff3cd;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
font-weight: bold;
}
@media (min-width: 768px) {
.container {
flex-direction: column;
}
.calculator-section, .article-section {
width: 100%;
}
}
BMI Calculator with Height and Weight
Calculate your Body Mass Index (BMI) quickly and easily.
Metric (kg, cm)
Imperial (lbs, in)
Your BMI Results
BMI Range Visualization
| BMI Range | Category | Health Risk |
|---|---|---|
| Below 18.5 | Underweight | Minimal |
| 18.5 – 24.9 | Normal weight | Minimal |
| 25 – 29.9 | Overweight | Low |
| 30 – 34.9 | Obesity Class I | Moderate |
| 35 – 39.9 | Obesity Class II | Severe |
| 40 and above | Obesity Class III | Very severe |
What is a BMI Calculator with Height and Weight?
A BMI calculator with height and weight is a fundamental health tool designed to estimate an individual’s body fat percentage based on their current weight and height. It provides a numerical value, the Body Mass Index (BMI), which is then categorized to offer insights into potential weight-related health risks. This tool is widely accessible, easy to use, and serves as a crucial first step for individuals looking to understand their weight status and its implications for overall well-being.
Who should use it? Anyone concerned about their weight, seeking to understand their general health status, or embarking on a fitness or weight management journey can benefit from using a BMI calculator. It’s particularly useful for:
- Individuals wanting a quick assessment of their weight category.
- People beginning a diet or exercise program.
- Healthcare providers for initial patient screening.
- Those curious about how their weight compares to general health guidelines.
Common misconceptions about BMI calculators often include viewing BMI as a definitive measure of health. While useful, BMI doesn’t account for muscle mass, bone density, or body composition. A very muscular person might have a high BMI but be perfectly healthy, while someone with a normal BMI could have low muscle mass and high body fat, posing health risks. It’s essential to remember that BMI is a screening tool, not a diagnostic one.
BMI Calculator with Height and Weight Formula and Mathematical Explanation
The Body Mass Index (BMI) is calculated using a straightforward mathematical formula that relates a person’s weight to their height. The standard formula is expressed differently depending on the unit system used.
Metric System Formula
In the metric system, the BMI formula is:
BMI = Weight (kg) / (Height (m))²
Where:
- Weight is measured in kilograms (kg).
- Height is measured in meters (m).
To use this formula, you must first convert your height from centimeters to meters by dividing by 100. For example, if your height is 175 cm, it would be 1.75 meters.
Imperial System Formula
In the imperial system, the formula requires a conversion factor:
BMI = (Weight (lbs) / (Height (in))²) * 703
Where:
- Weight is measured in pounds (lbs).
- Height is measured in inches (in).
- 703 is the conversion factor to adjust the units to a metric-equivalent scale.
Variable Explanation Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Weight | Body mass of the individual. | Kilograms (kg) or Pounds (lbs) | 1 kg – 500 kg (or 2 lbs – 1100 lbs) |
| Height | Body stature of the individual. | Centimeters (cm) or Inches (in) | 10 cm – 250 cm (or 4 in – 98 in) |
| BMI | Body Mass Index, a numerical value indicating weight status. | kg/m² | Varies widely, typically 10 – 70+ |
Practical Examples of Using a BMI Calculator
Understanding how to interpret BMI results is key. Here are a couple of practical examples:
Inputs:
- Weight: 65 kg
- Height: 168 cm
- Unit System: Metric
Calculation:
1. Convert height to meters: 168 cm / 100 = 1.68 m
2. Calculate BMI: 65 kg / (1.68 m * 1.68 m) = 65 / 2.8224 ≈ 23.03 kg/m²
Outputs:
- BMI: 23.0
- Category: Normal weight
- Health Risk: Minimal
Interpretation: This individual’s BMI falls within the ‘Normal weight’ range, suggesting a minimal health risk associated with their current weight.
Inputs:
- Weight: 150 lbs
- Height: 65 inches
- Unit System: Imperial
Calculation:
1. Calculate BMI: (150 lbs / (65 in * 65 in)) * 703 = (150 / 4225) * 703 ≈ 0.0355 * 703 ≈ 24.97
Outputs:
- BMI: 25.0
- Category: Overweight (borderline)
- Health Risk: Low
Interpretation: This individual’s BMI is at the very upper limit of the ‘Normal weight’ category and the lower limit of ‘Overweight’. While the immediate health risk is low, it indicates that maintaining or slightly reducing weight could be beneficial for long-term health.
How to Use This BMI Calculator with Height and Weight
Using our BMI calculator is simple and takes just a few steps. Follow these instructions to get your BMI score:
- Enter Your Weight: Input your current weight in the ‘Weight’ field. Select ‘kg’ for kilograms or ‘lbs’ for pounds based on your preference.
- Enter Your Height: Input your height in the ‘Height’ field. Select ‘cm’ for centimeters or ‘in’ for inches.
- Select Unit System: Ensure the ‘Unit System’ dropdown matches the units you used for weight and height (Metric or Imperial). If you select Imperial, the calculator will handle the conversion.
- Click ‘Calculate BMI’: Once all fields are filled, click the ‘Calculate BMI’ button.
How to read results:
- BMI Result: The primary number displayed is your Body Mass Index.
- BMI Category: This tells you if your BMI falls into the Underweight, Normal weight, Overweight, or Obesity categories.
- Health Risk: This indicates the potential health risks associated with your BMI category.
Decision-making guidance: While BMI is a screening tool, it can guide your next steps. If your BMI indicates you are underweight or overweight, consider consulting a healthcare professional or a registered dietitian. They can help you develop a personalized plan for achieving a healthier weight, considering your individual health status, body composition, and lifestyle.
Key Factors That Affect BMI Results and Interpretation
While the BMI formula is precise, several factors can influence the interpretation of your BMI score. Understanding these nuances is crucial for a holistic view of your health.
- Body Composition (Muscle vs. Fat): This is the most significant factor. Muscle is denser than fat. Athletes or individuals with high muscle mass might have a high BMI that misclassifies them as overweight, despite having low body fat and being very healthy. Conversely, individuals with low muscle mass and high body fat can have a “normal” BMI but still be at risk due to excess adiposity.
- Age: BMI interpretation can differ slightly with age. Muscle mass tends to decrease and fat mass may increase with age, even if weight remains stable. Some guidelines suggest slightly higher BMI ranges might be acceptable for older adults.
- Sex/Gender: Biological differences in body composition can influence BMI interpretation. On average, women tend to have a higher body fat percentage than men at the same BMI.
- Frame Size: Individuals with a naturally larger bone structure (large frame) might have a higher BMI than those with a smaller frame, even if they have similar body fat percentages.
- Pregnancy: BMI is not an accurate measure for pregnant individuals, as weight gain is expected and necessary during pregnancy. Healthcare providers use different metrics for monitoring weight during gestation.
- Ethnicity: Research suggests that certain ethnic groups may have different health risks associated with specific BMI ranges. For example, individuals of South Asian descent might face increased health risks at a lower BMI than populations of European descent.
Frequently Asked Questions (FAQ) about BMI Calculators
The ideal BMI is generally considered to be between 18.5 and 24.9, categorized as ‘Normal weight’. This range is associated with the lowest health risks for most adult populations.
No, this specific BMI calculator is designed for adults. BMI calculations for children and adolescents use age- and sex-specific growth charts to account for variations in development.
BMI is a screening tool, not a direct measure of health. It provides an estimate of body fat and potential weight-related risks but doesn’t account for muscle mass, bone density, or overall fitness.
If you are an athlete or very physically active and have a high BMI, it’s likely due to muscle mass. Consult a healthcare professional or a fitness expert to assess your body composition and health status accurately.
The BMI calculation itself is mathematically accurate based on the inputs. However, the interpretation of BMI as a measure of individual health is limited by factors like body composition.
Yes, our calculator supports both Metric (kg, cm) and Imperial (lbs, in) units. Simply select your preferred ‘Unit System’.
The conversion factor used in the Imperial BMI formula is 703. This factor is applied to adjust the ratio of weight (lbs) to height (in²) to be comparable to the metric BMI scale (kg/m²).
A BMI slightly above 25 (in the ‘Overweight’ category) doesn’t automatically mean you are unhealthy. It suggests an increased risk compared to the ‘Normal weight’ range. Factors like diet, exercise habits, and family history are also important considerations. Consulting a doctor is recommended for personalized advice.
var chartInstance = null; // Global variable to hold chart instance
function isValidNumber(value) {
return !isNaN(parseFloat(value)) && isFinite(value) && value >= 0;
}
function validateInputs() {
var weight = document.getElementById(“weight”).value;
var height = document.getElementById(“height”).value;
var weightError = document.getElementById(“weightError”);
var heightError = document.getElementById(“heightError”);
var valid = true;
if (!isValidNumber(weight) || parseFloat(weight) <= 0) {
weightError.textContent = "Please enter a valid positive weight.";
valid = false;
} else {
weightError.textContent = "";
}
if (!isValidNumber(height) || parseFloat(height) <= 0) {
heightError.textContent = "Please enter a valid positive height.";
valid = false;
} else {
heightError.textContent = "";
}
return valid;
}
function calculateBMI() {
if (!validateInputs()) {
return;
}
var weightInput = parseFloat(document.getElementById("weight").value);
var heightInput = parseFloat(document.getElementById("height").value);
var unitSystem = document.getElementById("unitSystem").value;
var weightKg = weightInput;
var heightCm = heightInput;
var bmi;
var bmiCategory;
var healthRisk;
if (unitSystem === "imperial") {
weightKg = weightInput * 0.453592; // Convert lbs to kg
heightCm = heightInput * 2.54; // Convert inches to cm
}
var heightM = heightCm / 100;
bmi = weightKg / (heightM * heightM);
bmi = Math.round(bmi * 10) / 10; // Round to one decimal place
var displayWeight = weightInput + (unitSystem === "imperial" ? " lbs" : " kg");
var displayHeight = heightInput + (unitSystem === "imperial" ? " in" : " cm");
document.getElementById("resultWeight").textContent = displayWeight;
document.getElementById("resultHeight").textContent = displayHeight;
document.getElementById("resultUnit").textContent = unitSystem.charAt(0).toUpperCase() + unitSystem.slice(1);
if (bmi = 18.5 && bmi = 25 && bmi = 30 && bmi = 35 && bmi = 40
bmiCategory = “Obesity Class III”;
healthRisk = “Very severe”;
}
document.getElementById(“bmiResult”).textContent = bmi + ” kg/m²”;
document.getElementById(“bmiCategory”).textContent = “Category: ” + bmiCategory + ” (Risk: ” + healthRisk + “)”;
updateChart(bmi);
}
function resetCalculator() {
document.getElementById(“weight”).value = “70”;
document.getElementById(“height”).value = “175”;
document.getElementById(“unitSystem”).value = “metric”;
document.getElementById(“weightError”).textContent = “”;
document.getElementById(“heightError”).textContent = “”;
document.getElementById(“bmiResult”).textContent = “–“;
document.getElementById(“bmiCategory”).textContent = “–“;
document.getElementById(“resultWeight”).textContent = “–“;
document.getElementById(“resultHeight”).textContent = “–“;
document.getElementById(“resultUnit”).textContent = “–“;
if (chartInstance) {
chartInstance.destroy();
chartInstance = null;
}
initializeChart(); // Re-initialize chart with default state
}
function copyResults() {
var bmi = document.getElementById(“bmiResult”).textContent;
var category = document.getElementById(“bmiCategory”).textContent;
var weight = document.getElementById(“resultWeight”).textContent;
var height = document.getElementById(“resultHeight”).textContent;
var unit = document.getElementById(“resultUnit”).textContent;
var formula = “BMI = Weight (kg) / (Height (m))² (Metric) or (Weight (lbs) / (Height (in))²) * 703 (Imperial)”;
var resultsText = “BMI Calculation Results:\n”;
resultsText += “BMI: ” + bmi + “\n”;
resultsText += category + “\n”;
resultsText += “Weight: ” + weight + “\n”;
resultsText += “Height: ” + height + “\n”;
resultsText += “Unit System: ” + unit + “\n”;
resultsText += “Formula: ” + formula;
try {
navigator.clipboard.writeText(resultsText).then(function() {
alert(“Results copied to clipboard!”);
}, function(err) {
console.error(‘Failed to copy: ‘, err);
alert(“Could not copy results. Please copy manually.”);
});
} catch (e) {
console.error(‘Clipboard API not available: ‘, e);
alert(“Clipboard API not available. Please copy manually.”);
}
}
function updateChart(currentBMI) {
var ctx = document.getElementById(“bmiChart”).getContext(“2d”);
// Define BMI categories and their upper bounds for x-axis
var bmiRanges = [
{ label: “Underweight”, max: 18.5, color: “#ffc107”, risk: “Minimal” },
{ label: “Normal”, max: 24.9, color: “#28a745”, risk: “Minimal” },
{ label: “Overweight”, max: 29.9, color: “#ffc107”, risk: “Low” },
{ label: “Obesity I”, max: 34.9, color: “#fd7e14”, risk: “Moderate” },
{ label: “Obesity II”, max: 39.9, color: “#dc3545”, risk: “Severe” },
{ label: “Obesity III”, max: 70, color: “#6f42c1”, risk: “Very severe” } // Max value for display
];
var datasets = [{
label: ‘BMI Category Ranges’,
data: [],
backgroundColor: [],
borderColor: ‘#fff’,
borderWidth: 1,
order: 2
}, {
label: ‘Your BMI’,
data: [{ x: currentBMI, y: 0.5 }], // Fixed y to show as a point
backgroundColor: ‘#004a99’,
borderColor: ‘#003366’,
borderWidth: 2,
type: ‘scatter’, // Use scatter for a single point
order: 1
}];
var labels = [];
var currentRangeIndex = -1;
for (var i = 0; i = start && currentBMI <= end) {
currentRangeIndex = i;
}
}
// Remove duplicate data points for bars
var cleanedData = [];
var cleanedBackgroundColors = [];
for(var i = 0; i < datasets[0].data.length; i+=2) {
cleanedData.push(datasets[0].data[i]);
cleanedData.push(datasets[0].data[i+1]);
cleanedBackgroundColors.push(datasets[0].backgroundColor[i]);
cleanedBackgroundColors.push(datasets[0].backgroundColor[i+1]);
}
datasets[0].data = cleanedData;
datasets[0].backgroundColor = cleanedBackgroundColors;
// Chart.js setup requires instance management
if (chartInstance) {
chartInstance.destroy();
}
chartInstance = new Chart(ctx, {
type: 'bar', // Base type is bar for ranges
data: {
labels: [], // Labels will be set via options tooltips/legend
datasets: datasets
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
type: 'linear',
position: 'bottom',
title: {
display: true,
text: 'BMI Value (kg/m²)'
},
min: 0,
max: 40, // Set a reasonable max for the x-axis
ticks: {
stepSize: 2 // Adjust step size for better readability
}
},
y: {
display: false // Hide Y axis as it's not relevant for ranges
}
},
plugins: {
legend: {
display: true,
position: 'bottom',
labels: {
// Generate labels dynamically with categories and risk
generateLabels: function(chart) {
var labels = [];
chart.data.datasets.forEach(function(dataset, i) {
if (dataset.type === 'scatter') {
labels.push({
text: 'Your BMI (' + currentBMI + ')',
fillStyle: dataset.backgroundColor,
strokeStyle: dataset.borderColor,
lineWidth: dataset.borderWidth,
fontStyle: 'bold'
});
} else {
bmiRanges.forEach(function(range, rIndex) {
if (i === 0 && rIndex === (i / 2)) { // Only add range label once
labels.push({
text: range.label + ' (' + range.risk + ')',
fillStyle: range.color,
strokeStyle: range.color,
lineWidth: 1
});
}
});
}
});
return labels;
}
}
},
tooltip: {
callbacks: {
title: function(tooltipItems) {
var item = tooltipItems[0];
var xValue = item.parsed.x;
var category = "N/A";
var risk = "N/A";
if (item.datasetIndex === 1) { // Your BMI scatter point
return "Your BMI Value";
}
for (var i = 0; i = bmiRanges[i].max && (i + 1 < bmiRanges.length ? xValue < bmiRanges[i+1].max : true)) {
category = bmiRanges[i].label;
risk = bmiRanges[i].risk;
break;
} else if (xValue < bmiRanges[0].max) {
category = bmiRanges[0].label;
risk = bmiRanges[0].risk;
break;
}
}
return category + " (" + risk + ")";
},
label: function(tooltipItem) {
if (tooltipItem.datasetIndex === 1) {
return " Current BMI: " + tooltipItem.parsed.x.toFixed(1);
}
return ""; // No label for range bars
}
}
}
},
layout: {
padding: {
top: 20,
left: 10,
right: 10,
bottom: 20
}
}
}
});
}
// Function to initialize the chart with default values
function initializeChart() {
var ctx = document.getElementById("bmiChart").getContext("2d");
// Define BMI categories for initial display
var bmiRanges = [
{ label: "Underweight", max: 18.5, color: "#ffc107", risk: "Minimal" },
{ label: "Normal", max: 24.9, color: "#28a745", risk: "Minimal" },
{ label: "Overweight", max: 29.9, color: "#ffc107", risk: "Low" },
{ label: "Obesity I", max: 34.9, color: "#fd7e14", risk: "Moderate" },
{ label: "Obesity II", max: 39.9, color: "#dc3545", risk: "Severe" },
{ label: "Obesity III", max: 70, color: "#6f42c1", risk: "Very severe" }
];
var datasets = [{
label: 'BMI Category Ranges',
data: [],
backgroundColor: [],
borderColor: '#fff',
borderWidth: 1,
order: 2
}];
for (var i = 0; i < bmiRanges.length; i++) {
var range = bmiRanges[i];
var start = (i === 0) ? 0 : bmiRanges[i – 1].max;
var end = range.max;
datasets[0].data.push({ x: start, y: 0.5 });
datasets[0].data.push({ x: end, y: 0.5 });
datasets[0].backgroundColor.push(range.color);
datasets[0].backgroundColor.push(range.color);
}
var cleanedData = [];
var cleanedBackgroundColors = [];
for(var i = 0; i < datasets[0].data.length; i+=2) {
cleanedData.push(datasets[0].data[i]);
cleanedData.push(datasets[0].data[i+1]);
cleanedBackgroundColors.push(datasets[0].backgroundColor[i]);
cleanedBackgroundColors.push(datasets[0].backgroundColor[i+1]);
}
datasets[0].data = cleanedData;
datasets[0].backgroundColor = cleanedBackgroundColors;
chartInstance = new Chart(ctx, {
type: 'bar',
data: {
labels: [],
datasets: datasets
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
type: 'linear',
position: 'bottom',
title: { display: true, text: 'BMI Value (kg/m²)' },
min: 0,
max: 40,
ticks: { stepSize: 2 }
},
y: { display: false }
},
plugins: {
legend: {
display: true,
position: 'bottom',
labels: {
generateLabels: function(chart) {
var labels = [];
chart.data.datasets[0].backgroundColor.forEach(function(color, i){
if (i % 2 === 0) { // Add label for each distinct range
var rangeIndex = i / 2;
labels.push({
text: bmiRanges[rangeIndex].label + ' (' + bmiRanges[rangeIndex].risk + ')',
fillStyle: color,
strokeStyle: color,
lineWidth: 1
});
}
});
return labels;
}
}
},
tooltip: { enabled: false } // Disable tooltip for initial state
},
layout: {
padding: {
top: 20,
left: 10,
right: 10,
bottom: 20
}
}
}
});
}
// Add Chart.js library – must be included before any Chart calls
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/chart.js@3.9.1/dist/chart.min.js';
script.onload = function() {
initializeChart(); // Initialize chart after Chart.js is loaded
};
document.head.appendChild(script);
// Initial calculation on load if fields have default values
document.addEventListener('DOMContentLoaded', function() {
calculateBMI();
document.getElementById("weight").addEventListener("input", calculateBMI);
document.getElementById("height").addEventListener("input", calculateBMI);
document.getElementById("unitSystem").addEventListener("change", calculateBMI);
});