PDF Editing Issues

Calculate BMI from Height and Weight in an Adobe Acrobat Form

Chanuka GeekiyanageChanuka Geekiyanage Nov 19, 2026 868 views

Question details

Calculate BMI automatically in an Acrobat form using weight in pounds and height entered in feet and inches.

Calculate BMI from Height and Weight in an Adobe Acrobat Form
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.
Before you start

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.

Solution 1Recommended

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.

1
Create the input fields

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.

2
Open the BMI calculation settings

Double-click the BMI result field to open Properties. Select the Calculate tab, choose Custom calculation script, and click Edit.

3
Enter the script

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; }

4
Test the form

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.

Add a custom BMI calculation to the Acrobat form
Input rules: FEET and WEIGHT are required. INCHES may be left blank or set to 0; when entered, it must be at least 0 and less than 12. PDF viewers must support Acrobat form JavaScript for the calculation to run.
Free Microsoft Office alternative

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.

View PDF forms alongside your other documentsOpen and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday document tasksGet started free with a lightweight office suite
microsoft office alternative - wps office

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.