Document parsing
Document parsing converts files such as PDFs, scans, slides and spreadsheets into structured text that software can use, keeping headings, reading order, tables and images instead of a flat stream of characters.
Also called: PDF parsing, document AI
By Divya Sharma · Checked Nov 15, 2026 · How we review
Most business knowledge sits in PDFs and office files, not clean text. Before a model can search or answer questions over them, something has to turn each page into text with its structure intact. That is document parsing, and its quality sets a ceiling on any retrieval-augmented generation system built on top.
How it works
A parser first reads whatever text the file already contains. For scanned pages it runs optical character recognition. It then applies layout analysis to find titles, paragraphs, figures and footnotes and to put them in reading order, and table extraction to rebuild rows and cells. The output is usually Markdown or JSON that keeps this structure, ready for chunking.
Two families of tools exist. Pipeline parsers such as Docling and Marker chain specialised models for layout, OCR and tables. Newer parsers send page images to a vision-language model and ask it to write out the content. Hosted APIs such as LlamaParse and Reducto offer either approach as a service.
Limits
Multi-column layouts, rotated scans, handwriting, charts and tables that span pages still trip up parsers. Vision-model parsers can also invent text that is not on the page, a form of hallucination. Check output against the source on a sample of your own documents before indexing a whole archive. The document parsing guide compares options.
Related terms
- Optical character recognition
- Optical character recognition (OCR) is software that reads text from images, such as scanned pages, photos or screenshots, and turns it into machine-readable characters that can be searched, copied or fed to a model.
- Vision-language model
- A vision-language model (VLM) is a model that takes images and text as input and produces text, so it can describe pictures, answer questions about them, read documents and extract data from screenshots.
- Layout analysis
- Layout analysis is the part of document parsing that finds the regions on a page, such as titles, paragraphs, tables, figures, captions and footers, labels each one, and works out the order a person would read them in.
- Table extraction
- Table extraction is the task of finding tables in documents and rebuilding their rows, columns, headers and cells as structured data, such as HTML, Markdown or CSV, instead of loose lines of text.
- Chunking
- Chunking is the step that splits long documents into smaller passages before they are embedded and indexed, so a retrieval system can find and return only the parts of a document that answer a query.