Body Mass Index calculator

Body mass index, or BMI, is a simple indicator that can be used to see whether your weight is in the healthy range. The calculation of BMI combines your height and weight to help predict their risk of developing disease.

Face with waiting expression Nothing to see yet!

Loading takeymakey...
TakeyMakey code
Want this tool to do something else? Edit the code below and make it do whatever you want.
({
  take: [
    { key: "kg", label: "Weight (kg)", type: "number" },
    { key: "cm", label: "Height (cm)", type: "number" },
  ],
  make: ({ kg, cm }) => {
    if (!kg || !cm) return "Add your weight and height to calculate your BMI."

    const bmi = +(kg / Math.pow(cm / 100, 2)).toFixed(1)
    const limits = [18.5, 25, 30]
    const ranges = ["underweight", "normal weight", "overweight", "obese"]

    let index = 0

    while (limits.length && bmi > limits.shift()) index++

    return {
      type: "card",
      title: bmi,
      body: `Your BMI is in the ${ranges[index]} range.`,
    }
  },
})