FDF (Forms Data Format) and XFDF (XML Forms Data Format) are lightweight file formats that store the values entered into PDF form fields — completely separate from the PDF document. A 5 MB PDF form with typed data can be represented by a 2 KB FDF file containing only the field names and values. Import the FDF into any copy of the original blank PDF and it fills in instantly. XFDF does the same thing but uses standard XML, making it easier to process with web servers and databases.
What Are FDF and XFDF?
Think about a 50-page insurance application. The PDF itself — with its layout, fonts, logos, and legal text — might be 8 MB. But the actual data you filled in: your name, address, date of birth, and policy number? That is maybe 3 KB of plain text. Sending the full 8 MB PDF back and forth for every submission wastes bandwidth, slows workflows, and creates storage problems at scale.
FDF solves this. Defined in the PDF specification (ISO 32000), FDF (Forms Data Format)
is a compact file — typically recognized by the .fdf extension — that contains only
field names and their values, plus a reference back to the PDF template they belong to. When opened
by a PDF viewer alongside the original document, the viewer reads each field name and populates
the corresponding input with the stored value.
XFDF (XML Forms Data Format) carries the same information but structures it as standard XML. This makes XFDF files readable and processable by any tool that understands XML — web servers, databases, ETL pipelines, JavaScript, Python — without requiring a specialized PDF library. XFDF is the recommended choice for most modern workflows.
Not just form data: FDF and XFDF can also carry PDF annotations (comments, highlights, stamps) and digital signatures — not only form field values. This makes them useful for collaborative document review workflows too.
FDF vs. XFDF: Key Differences
| Feature | FDF | XFDF |
|---|---|---|
| File extension | .fdf |
.xfdf |
| Syntax | PDF object syntax | Standard XML |
| Human-readable | Partially (PDF-like) | Yes — easily readable and editable |
| XML tool compatibility | No — requires PDF parser | Yes — any XML or text tool works |
| Introduced in | PDF 1.2 | PDF 1.5 |
| Supports annotations | Yes | Yes |
| Recommended for new projects | Legacy use | ✓ Yes |
What Does an XFDF File Look Like?
Here is a minimal XFDF file populating two fields in a contact form PDF:
<?xml version="1.0" encoding="UTF-8"?> <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"> <f href="contact-form.pdf"/> <!-- reference to the blank PDF --> <fields> <field name="First_Name"> <value>Jane</value> </field> <field name="Email"> <value>jane@example.com</value> </field> </fields> </xfdf>
How the Submit Button Really Works
Most people assume the Submit button on a PDF form sends the whole PDF to a server. In reality, it usually sends only an FDF or XFDF packet of the entered values. The form's submit action is configured with a URL and a submission format. The server receives a tiny data file, not the full document. This is why government e-filing portals can handle millions of daily submissions without enormous bandwidth costs.
%FDF-1.2 1 0 obj << /FDF << /F (contact-form.pdf) % reference to the blank PDF /Fields [ << /T (First_Name) /V (Jane) >> << /T (Email) /V (jane@example.com) >> ] >> >> endobj %%EOF
Same data, different syntax. Both files above carry identical information. XFDF is more verbose but far easier to parse with standard tools. FDF is more compact but requires a PDF-aware parser to read reliably.
Real-World Examples
Processing 10,000 University Applications
A university receives 10,000 digital application forms. Instead of staff manually opening each PDF and retyping data, the admissions system automatically extracts the XFDF data from every incoming submission. Field values — name, grade scores, program choice — flow directly into the student database in seconds. Missing required fields are flagged automatically. Confirmation emails go out without a human touching a single file.
Offline Inspection Reports That Sync Later
A field technician fills out equipment inspection reports on a tablet with no internet connection. The app saves the entered data as compact FDF files locally. When the technician returns to the office and connects to Wi-Fi, the app uploads the FDF files. The back-end merges each FDF with the official company PDF template, produces final signed reports, and archives them — all automatically, with no manual data entry.
Pre-Filling Customer Loan Applications
A bank already has a customer's personal details in its CRM. When the customer needs to sign a new loan application, the bank generates an XFDF file from their CRM record and merges it with the blank loan PDF. The customer receives a pre-filled form with their name, address, account number, and employment details already populated. They only need to review, complete the remaining fields, and sign — saving 20 minutes per application.
Benefits of FDF and XFDF
Tiny File Sizes
A 10 MB PDF form becomes a 5 KB FDF file. That is a 2,000× reduction for the data being transmitted between systems.
Database Integration
XFDF files are just XML. Any server-side language — Python, PHP, Java, Node.js — can parse and insert form values directly into a database.
One Template, Infinite Fills
Keep a single blank PDF on your server. Generate thousands of unique, pre-filled documents by injecting different XFDF data — no duplication of the document layout.
Round-Trip Data Flow
Export form data from a filled PDF as XFDF, edit the values in your system, then re-import — keeping field data and document separate throughout the lifecycle.
Security Separation
Transmitting only field values means you never expose the document's embedded fonts, images, or other sensitive layout assets over the network.
Annotation Export
FDF and XFDF can carry review comments and annotations separately from the PDF, enabling lightweight document review collaboration workflows.
Technical Details
What Can FDF / XFDF Contain?
Beyond basic field values, both formats support a wider set of data:
- Field values — text, checkbox states, radio button selections, list choices
- Annotations — comments, highlights, underlines, sticky notes, stamps
- Digital signatures — signature field placeholders and values
- Document references — the
/F(FDF) orhref(XFDF) attribute pointing to the source PDF - JavaScript actions — named JavaScript strings associated with fields (FDF only)
- Embedded files — file attachments referenced via FDF streams (FDF only)
FDF / XFDF Support in Common Tools
| Tool / Platform | FDF Support | XFDF Support |
|---|---|---|
| Adobe Acrobat / Reader | ✓ Full | ✓ Full |
| iText (Java / .NET) | ✓ Full | ✓ Full |
| Apache PDFBox | ✓ Full | ✓ Full |
| PyPDF2 / pypdf | Partial | Limited |
| Browser PDF viewers | ✗ No | ✗ No |
| macOS Preview | ✗ No | ✗ No |
Browser viewers do not support FDF/XFDF import. If your users open PDFs in Chrome, Firefox, or Safari's built-in viewer, they cannot import FDF/XFDF files directly. FDF and XFDF workflows work best with Adobe Acrobat, dedicated desktop viewers, or server-side PDF processing libraries.
Common Mistakes to Avoid
- Expecting browser PDF viewers to import FDF/XFDF. Chrome, Firefox, and Safari's built-in viewers do not support FDF or XFDF import. Always test your workflow with a viewer that explicitly supports these formats.
- Mismatching field names between the FDF and the PDF. FDF and XFDF field names are case-sensitive and must exactly match the field names defined in the AcroForm dictionary of the PDF. A single typo means the data will be silently ignored.
- Using FDF with XFA (dynamic) forms. XFA-based PDF forms do not use AcroForm fields — they use their own XML-based data binding. FDF and XFDF cannot be used to populate XFA forms. Use XFA's own data submission format instead.
- Confusing XFDF with raw XML form data. XFDF is not a generic XML format — it follows the specific schema defined in the Adobe XFDF specification. The root element, namespace, and field reference structure must be correct or PDF viewers will reject the file.
- Sending the whole PDF when only FDF/XFDF is needed. If your workflow involves collecting submitted form data on a server, configure the submit action to send XFDF — not the full PDF. Full-PDF submission is only necessary when you need the document layout, annotations, or embedded signature together with the data.
Frequently Asked Questions
-
FDF stands for Forms Data Format. It is a file format defined in the PDF specification (ISO 32000) that stores PDF form field values independently of the PDF document. An FDF file contains field names with their corresponding values, plus a reference to the PDF template. It uses the same syntax as PDF objects and carries the
.fdfextension. -
XFDF (XML Forms Data Format) is the XML-based version of FDF, introduced in PDF 1.5. It stores the same form data but in standard XML, making it easily processed by web servers, databases, and generic XML tools without a PDF-specific parser. XFDF is recommended for new projects because of its broad tool support and human-readability.
-
When a user or application imports an FDF or XFDF file into a PDF viewer, the viewer reads each field name in the file and populates the matching form field in the open PDF. The PDF document itself does not change — only the live field values are updated. The result looks exactly as if the data was typed directly into the form.
-
Most Submit buttons on government or enterprise PDF forms are configured to send form data as an FDF, XFDF, or HTML packet — not the entire PDF file. This keeps submissions tiny (often under 10 KB) regardless of how large the original PDF is. The server receives and processes only field values, not the document layout or embedded assets.
-
Yes. FDF and XFDF files can carry PDF annotations — comments, highlights, stamps, underlines — in addition to form field data. This makes them useful for collaborative review workflows where annotation data can be exported from one user's copy of the PDF and imported into another's, without exchanging the full document.
-
XFDF is supported by Adobe Acrobat, Adobe Reader, iText, PDFBox, and most professional PDF libraries. Browser-based PDF viewers — Chrome's built-in viewer, Firefox PDF.js — have no native FDF or XFDF import support. For server-side automation, XFDF is broadly supported across Python, Java, .NET, and PHP PDF libraries.
Edit and Manage PDF Forms with PDFlyst
Fill, sign, and edit PDF form fields right in your browser — no download required. Fast, free, and secure.
Open PDF Editor — Free