A simple BMI (Body Mass Index) calculator built using HTML, CSS, and JavaScript. Enter your weight (kg) and height (cm) to get your BMI value and a basic weight category.
https://avinash-sdbegin.github.io/BMI_CALCULATOR/
-
🧾 BMI formula used:
$$\text{BMI} = \frac{\text{weight (kg)}}{\text{height (m)}^2}$$ -
📏 Accepts height in cm (converted to meters internally)
-
✅ Validates inputs (rejects empty/zero/invalid values)
-
🩺 Shows BMI result with category:
- Underweight: BMI < 18.5
- Normal weight: 18.5–24.9
- Overweight: 25–29.9
- Obese: ≥ 30
- HTML
- CSS
- JavaScript (DOM events + basic validation)
BMIcalculator/
index.html
style.css
script.js
image.png
- Open
index.htmlin your browser. - Enter:
- Weight in kg
- Height in cm
- Click Calculate BMI.
If you use VS Code, you can run it with the Live Server extension:
- Install Live Server.
- Right-click
index.html→ Open with Live Server.
- To change BMI ranges or labels, edit the category logic in
script.js. - To change UI styling, edit
style.css.
This tool is for basic informational use only and does not replace medical advice.
