๐Ÿงฎ BMI Calculator App using HTML, CSS & JavaScript

sarfrazsarfraz
2 min read

๐Ÿ“Œ Introduction

Have you ever wondered if your body weight is healthy or not?
BMI โ€” Body Mass Index โ€” is a quick way to find out.

In this project, I built a BMI Calculator App using only HTML, CSS, and JavaScript.
It takes your height (in cm) and weight (in kg) as input and shows your BMI value and weight category:
โœ”๏ธ Underweight
โœ”๏ธ Normal
โœ”๏ธ Overweight

Let me walk you through how I made this app.


๐Ÿ“ท App Preview


๐Ÿง  What is BMI?

BMI (Body Mass Index) is a number that tells whether your body weight is healthy for your height.

It is calculated using the formula:

iniCopyEditBMI = weight (kg) / (height (m) ร— height (m))

For example, if your weight is 60kg and your height is 170cm (1.7m):

iniCopyEditBMI = 60 / (1.7 * 1.7) = 20.76

Based on the value:

  • BMI < 18.5 โ†’ Underweight

  • BMI 18.5 - 24.9 โ†’ Normal

  • BMI โ‰ฅ 25 โ†’ Overweight


๐Ÿ’ป How the App Works

You enter your height in centimeters and weight in kilograms.
The app calculates your BMI using JavaScript and shows:

  • Your BMI value (e.g., 22.5)

  • Your health status (Normal, Overweight, Underweight)


๐Ÿงฉ Technologies Used

  • HTML โ€“ for creating the input form and layout

  • CSS โ€“ for designing the interface

  • JavaScript โ€“ for logic and interaction


๐Ÿง  Core JavaScript Logic

Here's the logic that powers the app:


๐Ÿ”— Live Demo & Source Code


๐ŸŽฏ What I Learned

โœ… DOM manipulation
โœ… Form handling
โœ… Input validation
โœ… BMI logic and categorization
โœ… Styling and layout in CSS


๐Ÿ“ฃ Final Thoughts

This was a fun and simple project to build.
It taught me how real-world calculators work using basic math and JavaScript logic.

If youโ€™re just starting with web development, this is a perfect beginner project.
Try making your own version โ€” maybe add animations, charts, or even a dark mode!


๐Ÿ”— Currency Change App

๐Ÿ”— Random Joke App


๐Ÿง‘โ€๐Ÿ’ป About Me

Hi, Iโ€™m Sarfraz, a passionate IT student building my dream project โ€œPro Dev Seriesโ€.
Follow me for more full-stack web projects using simple HTML, CSS, and JavaScript.


Thanks for reading! ๐Ÿ’™
Let me know what you think in the comments ๐Ÿ‘‡

0
Subscribe to my newsletter

Read articles from sarfraz directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

sarfraz
sarfraz

I'm BSIT Student and want to become Full Stack Developer.