Interactive BMI Calculator: Assess Your Body Mass Index

BMI Calculator with Corrected Classification

/* CSS styling */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
}
.container {
text-align: center;
margin-top: 50px;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
label, input, button, p {
margin-bottom: 10px;
display: inline-block;
}
input[type=”number”] {
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#result {
color: #DAA520;
font-weight: bold;
}

BMI Calculator

function calculateBMI() {
var weight = document.getElementById(‘weight’).value;
var height = document.getElementById(‘height’).value;

var bmi = weight / (height/100 * height/100);
var classification = ”;

if (bmi < 16.5) {
classification = ‘Severe underweight’;
} else if (bmi < 18.5) {
classification = ‘Underweight’;
} else if (bmi < 25) {
classification = ‘Normal weight’;
} else if (bmi < 30) {
classification = ‘Overweight’;
} else if (bmi < 35) {
classification = ‘Obesity class I’;
} else if (bmi < 40) {
classification = ‘Obesity class II’;
} else {
classification = ‘Obesity class III’;
}

document.getElementById(‘result’).innerHTML =
‘Your BMI is: ‘ + bmi.toFixed(2) + ‘. Classification: ‘ + classification;
}

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Cloudflare

Verify you are human

loading

Checking your browser before accessing this site.
Click to verify →
Then you will be redirected to the requested content.
Ray ID: 8f3a2c1b9d4e5f6a · Performance & security by Cloudflare

site-verification-ok

Welcome Back!

Login to your account below

Retrieve your password

Please enter your username or email address to reset your password.