GLOSSARY
Document parsing
By Sygnet Research. Written by Sygnet, sourced, checked before publication.
Document parsing is the process of converting a document, typically a PDF, scanned image, or office file, into a structured, machine-readable format such as markdown, JSON, or XML. It preserves the meaningful structure of the original: headings, paragraphs, tables, lists, and reading order, rather than just dumping raw text. For LLM pipelines, parsing is the step that turns a messy file into something a model can actually reason over.
How it works
A document parser typically runs several steps in sequence. First, it segments the page into regions: text blocks, tables, figures, headers, footers. This is layout analysis, and it determines what gets read and in what order. Second, it extracts the actual content from each region. For text, this may involve native PDF text extraction or OCR if the file is a scanned image. For tables, it needs dedicated logic to keep rows and columns aligned rather than collapsing them into a single text blob. For figures and charts, a modern parser may generate a text description rather than discard the image entirely.
Third, the parser reassembles these pieces into a linear, structured output. Markdown is a common target because it is lightweight and preserves headings, lists, and tables in a form LLMs handle well. JSON is preferred when downstream systems need a strict schema rather than free text.
Two technical approaches dominate today. Traditional pipelines chain together OCR, layout detection models, and table-extraction models, each trained for a narrow task. Newer systems use a Vision-Language Model that reads the page image directly and produces structured output in one pass, trading some of the precision of specialized models for far less pipeline complexity. See our comparison of OCR vs VLM for the tradeoffs.
Why it matters for document processing
Bad parsing quietly breaks everything downstream. If a parser merges two columns of text into one garbled paragraph, or flattens a table into an unreadable string, no amount of prompt engineering fixes what an LLM receives afterward. This is the most underestimated failure point in RAG systems: retrieval and generation get most of the attention, but a corrupted document ingestion step poisons the whole pipeline silently.
Parsing quality directly affects straight-through processing rates, because extraction and classification models built on top of parsed output inherit its errors. In regulated workflows like contract analysis or KYC onboarding, a missed clause or a misread date in a poorly parsed table can cause real downstream harm, not just a bad chatbot answer. Teams evaluating tools should test parsing on their actual document mix (multi-column layouts, rotated scans, nested tables) before trusting any vendor's demo.
Related terms
- Document layout analysis
- Table extraction
- OCR vs VLM
- Vision-Language Model (VLM)
- Retrieval-Augmented Generation (RAG)
FAQ
Is document parsing the same as OCR?
No. OCR converts pixels into text characters, one narrow task. Document parsing is broader: it includes OCR when needed, but also layout analysis, table structure recovery, and reassembly into a structured format like markdown or JSON. A document can be parsed without any OCR at all if it is a native, text-based PDF.
Why do LLM pipelines need markdown or JSON instead of raw text?
Raw text extraction loses structure: tables become jumbled strings, headings disappear, reading order breaks on multi-column pages. Markdown and JSON preserve hierarchy and relationships, which helps an LLM understand what it is reading and improves accuracy on downstream tasks like extraction, summarization, or RAG retrieval.
NEXT STEP
See it on your own documents
One email when we publish something worth your time.