Calculate BMI from Height and Weight in an Adobe Acrobat Form
Question details
Calculate BMI automatically in an Acrobat form using weight in pounds and height entered in feet and inches.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form collects weight and height and displays a calculated BMI.
- Observed behavior
- The BMI field should update from the entered values and remain blank when the required inputs are missing or invalid.
Open the PDF in Adobe Acrobat and make sure you can edit its form fields. The script below expects fields named FEET, INCHES, and WEIGHT, with weight entered in pounds.
Add a custom BMI calculation to the Acrobat form
Use a custom calculation script when height is entered in separate feet and inches fields.
The script converts feet and inches to total inches, then calculates BMI as 703 multiplied by weight in pounds divided by height in inches squared. It rounds the result to two decimal places.
In Acrobat, open All tools > Prepare a form. Add or rename text fields to FEET, INCHES, and WEIGHT, and add a separate text field for the BMI result.
Double-click the BMI result field to open Properties. Select the Calculate tab, choose Custom calculation script, and click Edit.
Paste this script into the JavaScript editor and click OK: var feetText = this.getField("FEET").valueAsString; var inchesText = this.getField("INCHES").valueAsString; var weightText = this.getField("WEIGHT").valueAsString; var feet = Number(feetText); var inches = inchesText === "" ? 0 : Number(inchesText); var weight = Number(weightText); var totalHeight = feet * 12 + inches; if (feetText === "" || weightText === "" || !isFinite(feet) || !isFinite(inches) || !isFinite(weight) || feet < 0 || inches < 0 || inches >= 12 || weight <= 0 || totalHeight <= 0) { event.value = ""; } else { event.value = Math.round((703 * weight / Math.pow(totalHeight, 2)) * 100) / 100; }
Close Properties, preview the form, and enter values in FEET, INCHES, and WEIGHT. For example, 5 feet, 10 inches, and 150 pounds should produce approximately 21.52. Clear FEET or WEIGHT to confirm that the result becomes blank.

Work with PDFs and office files in WPS Office
WPS Office is a free, lightweight alternative for viewing PDFs and working with office documents in a familiar interface. Its Microsoft Office format compatibility makes it easier to move existing files into your workflow. Use Acrobat to create and test the custom PDF form script described above.

Frequently Asked Questions
Can I calculate BMI if height is entered only in inches?
Yes. In the BMI field's Properties > Calculate > Custom calculation script, use the height-in-inches field directly instead of converting feet. Calculate 703 times weight in pounds divided by the square of height in inches, and leave the result blank if either value is missing or not positive.
Why does the BMI field stay blank?
Check that the input fields are named exactly FEET, INCHES, and WEIGHT in Prepare a form. The supplied script also requires FEET and WEIGHT, a positive total height and weight, and an INCHES value below 12.
Will the calculation work in every PDF viewer?
Not necessarily. The viewer must support Acrobat form JavaScript and allow it to run. Test the completed form in the PDF viewer your users will use.
Can I enter zero in the inches field?
Yes. Enter 0 in INCHES for an exact number of feet, or leave INCHES blank. The script treats a blank inches field as zero.




