Most RAG failures start before the embedding model ever runs. They start in the parser. A retriever can only find what the ingestion pipeline extracted, and a sloppy parser turns tables into soup, drops footnotes, and merges columns into nonsense.
Three tools dominate the document-parser conversation in 2026: Unstructured, LlamaParse, and Docling. Each takes a different route to clean, structured text your chunker and retriever can work with.
Unstructured: The Flexible ETL Workhorse
Unstructured is an open-source Python toolkit built around one idea: every document becomes a list of typed elements. A PDF page turns into Title, NarrativeText, Table, ListItem, Image, and other element types you can filter, clean, and chunk downstream.
How it works
The core API is the partition family of functions. partition_pdf, partition_docx, partition_html, and siblings auto-detect the input and return elements. For PDFs you pick a strategy: fast extracts embedded text quickly, hi_res runs layout-detection models for complex pages, and ocr_only forces OCR across the whole document.
Unstructured also ships as a hosted platform and API for teams that want the same pipeline without running it. The open-source library stays free under Apache 2.0.
Strengths
The element model is the big win. Because output is typed, your chunking code can treat tables differently from prose, drop headers and footers by element type, and keep metadata like page numbers attached to every chunk. That metadata is gold for citations in RAG answers.
The connector ecosystem is wide: S3, Google Drive, SharePoint, and other sources plug in, and both LangChain and LlamaIndex ship loaders.
Trade-offs
Quality depends heavily on the strategy you pick. fast mode on a messy PDF gives messy elements. hi_res mode is slower and pulls in heavier model dependencies, so expect real install and runtime overhead.
The project moves fast, which means APIs and defaults shift between releases. Pin your versions in production.
Key takeaway: Pick Unstructured when you need a programmable pipeline with typed elements and broad source connectors, and you are comfortable tuning the PDF strategy per document type.
LlamaParse: The Hosted Quality Play
LlamaParse is the document-parsing service from the LlamaIndex team, delivered as a hosted API on LlamaCloud. You send a file, you get back clean markdown or JSON shaped for LLM ingestion. There is no pipeline to configure and no models to host.
How it works
Upload a PDF, DOCX, PPTX, spreadsheet, or image and LlamaParse returns structured output with tables preserved, reading order reconstructed, and images optionally described. Newer parsing modes apply more capable models to difficult layouts, trading latency and cost for accuracy.
Because it is a service, updates land without you doing anything. The output format stays stable while the models behind it improve.
Strengths
Output quality on difficult PDFs is the selling point. Multi-column layouts, nested tables, and mixed text-image pages come out cleaner than most local pipelines produce, which directly reduces the chunk-cleaning code you have to write.
Integration with the LlamaIndex ecosystem is native. If your RAG stack already runs on LlamaIndex, parsed documents drop straight into your ingestion flow with page-level metadata intact.
Trade-offs
It is a paid API with a limited free tier, so cost scales with page volume. Check current pricing before committing a large corpus. Your documents also leave your network, which rules it out for strict data-residency requirements.
You trade control for convenience: when the service changes behavior, you adapt, with no local fallback.
Key takeaway: Pick LlamaParse when parsing quality matters more than per-page cost, your documents are messy, and sending files to a hosted API is acceptable.
Docling: The Local Open-Source Contender
Docling started at IBM Research and now lives under the Linux Foundation as an open-source project. It converts PDF, DOCX, PPTX, XLSX, HTML, images, and even audio into a unified document model, then exports JSON or markdown. Everything runs on your own machines.
How it works
Docling runs a real AI pipeline locally: layout detection trained on DocLayNet finds text blocks, titles, and figures, while the TableFormer model recovers table structure including spanning cells. OCR engines plug in for scanned pages. The result is a DoclingDocument with full structure, exported to the format your chunker wants.
It ships as a Python library and a CLI, with ready integrations for LangChain and LlamaIndex. MIT licensing keeps commercial use simple.
Strengths
You get serious layout and table models without sending data anywhere. For teams with data-residency rules, that alone can decide the contest. Table structure recovery is genuinely strong, which matters because tables carry the densest information in business documents.
The unified document model is well designed. One JSON schema covers every input format, so downstream code stays format-agnostic.
Trade-offs
You own the infrastructure. GPU acceleration helps throughput, and model downloads make the first run heavier than a pure-Python library. The ecosystem is younger than Unstructured’s, so expect fewer source connectors and community snippets.
Head-to-Head Comparison
| Dimension | Unstructured | LlamaParse | Docling |
|---|---|---|---|
| Approach | Element-based ETL pipeline | Hosted parsing API | Local AI pipeline |
| License and cost | Apache 2.0 library free; hosted platform paid | Paid API, limited free tier | MIT, free, self-hosted |
| Deployment | Library, Docker, or hosted | Hosted only | Local library or CLI |
| Table extraction | Good, strategy-dependent | Strong on complex layouts | Strong via TableFormer |
| OCR for scanned docs | Yes via Tesseract or hi_res | Yes, handled by service | Yes, pluggable OCR engines |
| Output formats | Elements, JSON, text, HTML | Markdown, JSON, text | DoclingDocument JSON, markdown |
| Framework integrations | LangChain, LlamaIndex loaders | Native LlamaIndex | LangChain, LlamaIndex |
| Data residency | Full control self-hosted | Documents leave your network | Full control self-hosted |
| Best for | Programmable multi-source pipelines | Max quality, zero ops | Local parsing with strong tables |
Choosing by Document Type
The right parser depends less on brand and more on what your documents look like.
Clean native PDFs
If your PDFs have selectable text and simple layouts, a lightweight extractor plus a good chunker gets you far. When you want structure metadata, Docling or Unstructured in fast mode both handle this tier.
Complex layouts and dense tables
Annual reports, research papers with multi-column text, and financial statements with nested tables are where parsers earn their keep. LlamaParse and Docling lead here thanks to dedicated layout and table models. Unstructured’s hi_res strategy competes but needs tuning.
Scanned documents
OCR quality decides everything. All three handle it: Unstructured with ocr_only, Docling with pluggable OCR engines, LlamaParse as a service. If scans must never leave your network, the choice is between Unstructured and Docling.
Office documents and web pages
DOCX, PPTX, and HTML are the easy tier. All three parse them reliably. Pick based on your other constraints, like whether you already run one of them for PDFs.
Choosing by Deployment Constraint
Data must stay on your infrastructure
Eliminate LlamaParse immediately. Docling is the smoothest local option for quality, while Unstructured wins if you need the connector ecosystem for scattered sources.
Cost at scale dominates
Self-hosted wins as page volume grows. Docling and Unstructured cost compute, not per-page fees. Model your break-even point: a few thousand pages a month may favor the API, while millions of pages favor local pipelines.
You want zero operations burden
LlamaParse is the answer. No models to download, no GPU to provision, no pipeline to maintain. Accept the per-page cost and the data-leaves-network trade-off consciously.
Frequently Asked Questions
Do these parsers work with LangChain and LlamaIndex?
Yes. Unstructured has document loaders in both frameworks, LlamaParse ships a native LlamaIndex reader, and Docling integrates with both.
In all three cases, page numbers and structure metadata flow through to your chunks.
Which parser handles tables best for RAG?
Tables need structure preserved, not just text extracted. Docling’s TableFormer and LlamaParse’s layout models both recover table structure well, including spanning cells. Whichever you pick, keep each table in a single chunk when possible so the retriever sees the full context.
Should I run OCR on every PDF?
No. Extract embedded text first and fall back to OCR only for pages without it, since blind OCR on native PDFs wastes compute and can degrade quality. Docling and Unstructured both support this detect-then-OCR pattern.
How much does parsing quality actually affect RAG answers?
Directly. Retrieval works on chunks, and chunks come from parsed output. Merged columns, dropped table headers, and lost reading order all become wrong or incomplete answers, which makes parser choice one of the decisions that most shapes a RAG pipeline.
Bottom Line
There is no universal winner, only the right fit. Unstructured suits programmable multi-source pipelines, LlamaParse suits teams that want top quality with zero ops, and Docling suits local-first parsing with strong tables. Match the parser to your documents first and your deployment constraints second.