What Is XFDF? The XML Format for PDF Annotations Explained
An XFDF file is the XML representation of PDF annotations. XFDF stands for XML Forms Data Format, and it was introduced by Adobe as a portable, human-readable way to carry PDF highlights, comments, and form data separately from the PDF document itself. Instead of embedding annotations inside the binary PDF, XFDF stores them in a plain-text XML structure that compatible tools can parse, diff, and convert — which is exactly why pdfannotations.com uses it as one of its supported input formats alongside PDF and XML FDF.
If you have ever exported annotations from Adobe Acrobat and ended up with a small .xfdf file sitting next to your PDF, this guide explains what that file actually contains, how it compares to the older FDF format, and how to open, view, and convert XFDF files into Markdown, Obsidian notes, JSON, or CSV.
What Does XFDF Stand For?
XFDF expands to XML Forms Data Format. Breaking that down:
- XML — the file is plain Extensible Markup Language, which means you can open it in any text editor, diff it in git, and parse it with any standard XML library.
- Forms Data — the format was originally designed to carry form field values, but Adobe extended it to also carry annotation data (highlights, sticky notes, underlines, strikeouts, free text).
- Format — it is a published specification, not a proprietary binary blob. Adobe documents the XFDF schema in the Acrobat SDK.
The result is a tiny XML file — often just a few kilobytes — that captures the annotations written to the file by your PDF application, ready to be re-imported into Acrobat or fed into a converter like pdfannotations.com.
What Is Inside an XFDF File?
An XFDF file is structured XML. The root element is <xfdf>, and inside it you typically find:
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<f href="research-paper.pdf"/>
<ids original="abc123def456" modified="789012abc"/>
<annots>
<highlight page="0" color="#FFEB3B" opacity="1.0"
subject="Highlight" name="ann_001"
date="D:20260720120000Z" creationdate="D:20260720115900Z">
<contents>This is the key argument of the paper.</contents>
<Popup page="0" rect="100,200,300,250" open="no"/>
</highlight>
<text page="2" color="#4F46E5" opacity="1.0"
subject="Note" name="ann_002"
date="D:20260720121000Z">
<contents>Review this section carefully before citing.</contents>
<Popup page="2" rect="120,220,260,260" open="no"/>
</text>
<underline page="5" color="#FF9800"
subject="Underline" name="ann_003"
date="D:20260720121500Z">
<contents>Definition of construct validity.</contents>
<Popup page="5" rect="80,180,300,220" open="no"/>
</underline>
</annots>
</xfdf>
The most important elements are:
| Element | Purpose |
|---|---|
<f href="..."/> |
Points back to the source PDF filename. |
<ids> |
Internal Acrobat identifiers used for round-tripping. |
<annots> |
Container for all annotation elements. |
<highlight>, <text>, <underline>, <strikeout> |
Individual annotation types. |
page attribute |
Zero-indexed page number where the annotation lives. |
color attribute |
RGB hex color of the markup. |
date / creationdate |
Adobe PDF date format (D:YYYYMMDDHHmmSSZ). |
<contents> |
The comment or note text you typed. |
<Popup> |
Position of the floating comment popup in the source PDF. |
Because XFDF is plain XML, you can inspect any annotation by hand, write scripts against it, or convert it into any other format with a few lines of code.
XFDF vs FDF vs PDFAnnotations
PDF annotations can live in three different places, and each has trade-offs. Understanding the difference helps you pick the right format for your workflow.
Embedded PDF Annotations
Annotations live inside the PDF file itself as part of the page's annotation array. This is what happens when you highlight text and simply save the PDF.
- Pros: Self-contained — one file has everything.
- Cons: Every edit rewrites the (potentially huge) PDF. Sharing annotations means sharing the entire document. Hard to diff or version-control.
FDF (Forms Data Format)
FDF is Adobe's older sidecar format for carrying form data and annotations separately from the PDF. It may use traditional binary encoding or XML encoding. If you have an .fdf file, drag it into the FDF annotation converter: XML FDF parses directly, while a traditional binary file is flagged as unsupported.
- Pros: Smaller than the full PDF; round-trips cleanly with Acrobat.
- Cons: Traditional binary files are not human-readable, do not diff cleanly, and require specialized parsers; XML FDF is readable but less widely supported than XFDF.
XFDF (XML Forms Data Format)
XFDF is the XML successor to FDF. Same data model, but encoded as XML.
- Pros: Human-readable, diffs cleanly in git, relatively easy to parse with XML libraries, usually smaller than the source PDF, and supported by many modern PDF tools.
- Cons: Slightly larger file size than FDF due to XML verbosity (but still tiny — a few KB).
Quick Comparison
| Property | Embedded PDF | FDF | XFDF |
|---|---|---|---|
| Encoding | Binary | Binary or XML | XML (plain text) |
| Human-readable | No | XML FDF only | Yes |
| Diffs cleanly in git | No | XML FDF only | Yes |
| Contains annotation data | Yes | Yes | Yes |
| Contains page content | Yes | No | No |
| File size | Large | Small | Small |
| Round-trips with Acrobat | Yes | Yes | Yes |
| Supported by pdfannotations.com | Yes | XML FDF only | Yes |
For almost all modern workflows, XFDF is the right choice. It is the format Adobe recommends for new projects, and the most widely supported text format you can meaningfully inspect by hand.
Why Use XFDF Instead of Embedded Annotations?
There are several scenarios where exporting XFDF is preferable to leaving annotations embedded in the PDF:
- Sharing annotations without sharing the document. You can send a colleague a 5 KB XFDF file instead of a 50 MB PDF. They apply it to their own copy of the PDF in Acrobat.
- Version-controlling annotations. Because XFDF is plain text, you can commit it to git alongside the PDF and track exactly which highlights were added when.
- Converting annotations to other formats. XFDF is the easiest input for tools like pdfannotations.com — the XML structure maps directly onto Markdown headings, JSON fields, and CSV columns.
- Multiple reviewers. Each reviewer can export their own XFDF from the same source PDF, and you can merge them later without overwriting each other's annotations.
- Long-term archiving. XFDF will outlive any specific PDF reader. As long as XML parsers exist (which they will for the foreseeable future), your annotations remain readable.
How to Open an XFDF File
Because XFDF is plain XML, you have many options for opening it:
Open in a Text Editor
Any text editor — VS Code, Sublime Text, Notepad, BBEdit, Vim — can open an XFDF file. This is the fastest way to inspect what is inside without installing anything. The XML structure is self-documenting once you know the element names (highlighted above).
Open in a Browser
Open the .xfdf file in a browser that supports XML display. Browsers render XML with collapsible nodes, which is a useful way to navigate a large annotation set quickly.
Re-import into Adobe Acrobat
In Acrobat, choose File → Import → Data (or Comments → Import Comments), select your XFDF file, and Acrobat will re-attach the annotations to the matching PDF. The PDF must be the same document (or a copy of it) for the annotations to land in the correct positions.
Import to pdfannotations.com
Drag the XFDF file into our XFDF annotation converter. The parser runs entirely in your browser — the file is never uploaded to a server — and renders supported annotations in a sortable, filterable workspace. Markdown, CSV, and plain text are free; Obsidian, Notion, JSON, Excel, and AI formats are available in Pro.
Parse with Code
Because XFDF is XML, parsing it in any programming language takes only a few lines. For example, in Python:
import xml.etree.ElementTree as ET
tree = ET.parse('annotations.xfdf')
root = tree.getroot()
ns = {'xfdf': 'http://ns.adobe.com/xfdf/'}
for annot in root.findall('.//xfdf:annots/*', ns):
page = annot.get('page')
color = annot.get('color')
contents = annot.findtext('xfdf:contents', default='', namespaces=ns)
print(f"Page {page} [{color}]: {contents}")
That snippet prints every annotation in the file in under 20 lines. The same logic applies in JavaScript, Go, Rust, Java, or any language with an XML library.
How to Convert an XFDF File
Once you have an XFDF file, you typically want to convert it into a more useful format. The conversion options available in pdfannotations.com are:
- Markdown — free, portable output for any Markdown editor
- CSV — free table output for spreadsheets and pivot analysis
- Text — free plain-text output for email or chat
- Obsidian — Pro format with Callouts, YAML Frontmatter, and page references
- Notion — Pro paste-ready format for databases
- JSON — Pro format for programmatic pipelines
- Excel — Pro
.xlsxoutput with structured columns - ZIP — Pro bundle for multiple formats
- AI Context Markdown — Pro structure for LLM prompts
- RAG JSON — Pro schema for vector database ingestion
For step-by-step instructions on getting XFDF out of Adobe Acrobat in the first place, see our how to export XFDF annotations guide.
XFDF File Size and Limits
XFDF files are tiny. A 300-page academic paper with 200 highlights and 50 sticky notes produces an XFDF file of roughly 20–40 KB. The format itself does not impose a fixed annotation count, but practical usability depends on the source application, file size, and browser. Split very large annotation sets when files become difficult to manage.
The workspace displays up to 10,000 annotations per file. Larger sets are truncated; split the source or export before combining results in Pro.
Common XFDF Myths
"XFDF only works with Adobe Acrobat"
Not every reader. XFDF is an XML schema published by Adobe, and several PDF applications can import or export it, but support and annotation mapping vary. Test your file in the destination application before relying on the round trip.
"XFDF is deprecated"
False. XFDF remains the recommended interchange format for PDF annotations. The older traditional FDF format is the one that has been effectively superseded. Need to read an XML FDF file? Use the FDF annotation converter; for XFDF, the XFDF annotation converter handles that side.
"XFDF cannot carry form data"
False. XFDF carries both form data and annotation data. The <fields> element holds form field values; the <annots> element holds annotations. Most XFDF exports from Acrobat focus on the annotation side, but the format supports both.
"XFDF loses color information"
Not always. XFDF can store color as a color attribute, but color is available only when the source application writes it. Destination applications may also apply different defaults, so verify colors after re-import.
When Should You Use XFDF?
XFDF is the right choice when you need any of the following:
- A portable annotation payload that travels separately from the source PDF
- A human-readable format you can inspect, diff, or hand-edit
- A convertible input for a tool like pdfannotations.com that turns annotations into Markdown, Obsidian, JSON, or CSV
- A version-controllable representation of annotations in git
- A multi-reviewer workflow where each person exports their own XFDF and you review or merge the results carefully
If you only ever read PDFs in a single reader and never need to reuse the highlights elsewhere, embedded PDF annotations are fine. The moment you want to do anything beyond reading, XFDF becomes the better choice.
Frequently Asked Questions
What does .xfdf stand for?
XFDF stands for XML Forms Data Format. It is the XML-encoded representation of PDF form data and annotations.
Is XFDF the same as FDF?
No. Traditional FDF is the older PDF-object format; XFDF is the XML successor. Acrobat can also export XML FDF, but XFDF is human-readable, more widely supported, and easier to parse.
Can I open an XFDF file without Adobe Acrobat?
Yes, in tools that support XML. Text editors can display the contents and XML libraries can parse the structure. For free Markdown or CSV conversion plus Pro advanced formats, use the pdfannotations.com XFDF converter.
Does XFDF preserve highlight colors?
Only if the source application writes the color attribute. pdfannotations.com preserves available color data in formats that support that metadata.
Can I edit an XFDF file by hand?
You can, but back up the file first. XFDF is XML, so a text editor can modify text, colors, or pages; save it as plain text with the .xfdf extension and test the re-import.
Related Guides
Want to learn more? Check out these related guides:
- How to Export XFDF Annotations from Adobe Acrobat - Step-by-step instructions for getting an XFDF file out of Acrobat and into a converter
- XFDF to Obsidian: Convert Adobe PDF Annotations to Markdown - Turn XFDF exports into linked, tagged Obsidian notes with Callouts and Frontmatter
- PDF Annotations to AI and RAG - Feed XFDF-exported annotations into ChatGPT, Claude, Gemini, or a vector database
- Export PDF Highlights to Obsidian: Complete Workflow Guide - The full Obsidian workflow for PDFs with standard annotations
- PDF to Markdown Best Practices - Clean conversion patterns that work across Obsidian, Notion, and beyond
Try the annotation extraction tool
Open an annotated PDF and export annotations locally. Markdown, CSV, and plain text are free.
Extract PDF Annotations →