---
title: "JavaScript library to read PDF form fields | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/forms/read-form-fields/"
md_url: "https://www.nutrient.io/guides/web/forms/read-form-fields.md"
last_updated: "2026-05-18T13:37:23.538Z"
description: "Learn to read PDF form fields using the Nutrient Web SDK’s asynchronous API. Retrieve an immutable list of form fields and their values efficiently."
---

# Read PDF form fields using JavaScript

Reading all form field objects can be done by using the [`Instance#getFormFields`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#getFormFields) API. This API is asynchronous and will return a promise that resolves to an [immutable list](https://www.nutrient.io/api/web/NutrientViewer.Immutable.List.html) of [`FormField`](https://www.nutrient.io/api/web/NutrientViewer.FormFields.FormField.html) elements and contains their current values. Every `FormField` has a unique [`name`](https://www.nutrient.io/api/web/NutrientViewer.FormFields.FormField.html#name) property. In the PDF spec, this is often referred to as the fully qualified name (FQN). This name is similar to an input element’s `name` attribute in an HTML form and is used to associate the filled-out value with the form field:

```js

const formFields = await instance.getFormFields();
console.log(formFields.size);

```

Form fields are rendered following the properties of their associated [widget annotation(s)](https://www.nutrient.io/api/web/NutrientViewer.Annotations.WidgetAnnotation.html), which are listed by `id` in the form field’s [`annotationIds`](https://www.nutrient.io/api/web/NutrientViewer.FormFields.FormField.html#annotationIds) property. Widget annotations behave like regular [annotations](https://www.nutrient.io/guides/web/annotations/introduction-to-annotations.md) and can be loaded via the regular [annotations API](https://www.nutrient.io/guides/web/annotations/introduction-to-annotations.md#working-with-annotations-in-code).
---

## Related pages

- [Flatten dynamic PDF forms using JavaScript](/guides/web/forms/flatten.md)
- [Extract data from PDF form fields using JavaScript](/guides/web/forms/extract-form-data.md)
- [JavaScript PDF fillable form library](/guides/web/forms.md)
- [Validate PDF forms using JavaScript](/guides/web/forms/javascript-validation.md)
- [Master PDF actions with JavaScript integration](/guides/web/forms/pdf-actions-support.md)

