---
title: "Discussion on \"Building a BMI Calculator: Metric and Imperial Formulas, Health Category Ranges, and Ideal Weight Calculation\" | Hashnode"
description: "Discussion on \"Building a BMI Calculator: Metric and Imperial Formulas, Health Category Ranges, and Ideal Weight Calculation\". How to implement a BMI calculator with correct metric and imperial formulas, WHO health category ranges, ideal body weight (Devine formula), and BMI-for-age context."
url: "https://hashnode.com/posts/building-a-bmi-calculator-metric-and-imperial-formulas-health-category-ranges-and-ideal-weight-calculation/6a01ae3cd3d2779fe751a42d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building a BMI Calculator: Metric and Imperial Formulas, Health Category Ranges, and Ideal Weight Calculation](https://ultimatetools.hashnode.dev/building-a-bmi-calculator-metric-and-imperial-formulas-health-category-ranges-and-ideal-weight-calculation?utm_source=hashnode&utm_medium=feed)

How to implement a BMI calculator with correct metric and imperial formulas, WHO health category ranges, ideal body weight (Devine formula), and BMI-for-age context.

May 11 · 4 min read · ultimatetools.hashnode.dev  
Read the article

-   [#health](https://hashnode.com/tag/health)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#webdev](https://hashnode.com/tag/webdev)

## Written by

[Shaishav Patel](https://hashnode.com/@shaishavap)

@shaishavap · Mumbai, India

  
[View profile](https://hashnode.com/@shaishavap)

## Responses 2

Markdown supported · ⌘↵ to post

[Sam Rivera](https://hashnode.com/@samrivera)

[May 31](https://hashnode.com/posts/building-a-bmi-calculator-metric-and-imperial-formulas-health-category-ranges-and-ideal-weight-calculation/6a01ae3cd3d2779fe751a42d/comment/6a1c4debd42e27156f82b2c1)

this is a solid breakdown of the math behind it. i built a quit-smoking tracker recently (day 36 after 12y of smoking) and went through the same process of figuring out the edge cases - unit conversions, what to show vs what to hide. the WHO category boundaries are surprisingly nuanced when you actually implement them. nice work

[Shaishav Patel](https://hashnode.com/@shaishavap)

[May 31](https://hashnode.com/posts/building-a-bmi-calculator-metric-and-imperial-formulas-health-category-ranges-and-ideal-weight-calculation/6a01ae3cd3d2779fe751a42d/comment/6a1c4debd42e27156f82b2c1#reply-6a1c5cb769c80d28f6542574)

Thank you, Sam — and seriously, congrats on day 36 after 12 years. That's the harder build by a mile. 👏

You hit the exact thing most people miss: the WHO boundaries look trivial until you actually implement them. The one that got me was rounding — show BMI to one decimal and a 24.95 quietly rounds to 25.0, flipping "normal" to "overweight" right at the edge, so I had to decide whether to categorize on the raw value or the displayed one. And the Asian-Pacific cutoffs (overweight at ≥23) are a whole separate "what do we show vs hide" call.

Sounds like your quit-smoking tracker ran into the same wall — the boundaries are where all the real decisions live. I'd genuinely like to see it; is it public anywhere?
