Document parsing: how it works, methods, software and tools

For operations, finance and engineering teams. It explains what document parsing is and the steps from file to structured data. It also shows how rule-based, AI and LLM parsers compare, the tools available and how to choose.

Illustration of a person placing the Docsumo icon into an app window as documents flow in and become charts and data

Key takeaways

  • Document parsing turns a document, such as a PDF, scan, Word file or email, into structured data. The result is named fields, tables and text in reading order.
  • The pipeline is text extraction or OCR, layout analysis, classification, field and table extraction, validation and export.
  • There are three approaches. Rule-based parsers are for fixed layouts. AI and document AI parsers are for varied layouts. LLM-based parsers turn documents into clean text or JSON.
  • Parsing for business data gives you values like the total on an invoice. Parsing for AI search and RAG, where an AI assistant answers from your documents, gives you a PDF as clean markdown. These are different jobs with different tools.
  • Choose a parser by accuracy on your documents, table handling, validation and review, and integration, not by format support alone.
On this page
  1. What is document parsing?
  2. How document parsing works
  3. Rule-based, AI and LLM parsers
  4. Document parsing software and tools compared
  5. Document parsing use cases
  6. Build or buy?
  7. How to choose a document parser
  8. Start from the job, not the label
  9. Frequently asked questions

Document parsing turns a document, such as a PDF, scan, Word file or email, into structured data that software can use. The data comes out as named fields, tables and text in the right reading order. A parser reads the file and works out its layout. It finds the values you need, such as the invoice number or every transaction on a statement. Then it outputs them as JSON, CSV or records in another system.

What is document parsing?

Parsing means analyzing input and giving it structure. Data formats like JSON already carry their structure (see data parsing). Documents don't, for three reasons:

  • Digital PDFs have no structure

    A PDF stores characters at positions on a page, with no notion of "this is a table row" or "this is the total."
  • Scans have no text

    A scan or photo is just an image; there's no text until OCR reads it.
  • Layouts vary

    Every vendor's invoice and every bank's statement puts the same information in a different place.

A document parser has to rebuild structure from what's on the page.

How document parsing works

  • Digital PDFs
  • Scans and photos
  • Word files
  • Emails
Parser
  1. 01Get the text
  2. 02Analyze the layout
  3. 03Classify
  4. 04Extract fields and tables
  5. 05Validate
JSON, CSV or your system
How a document becomes structured data

Take a scanned bank statement that arrives as an email attachment. It's an image, so the parser runs OCR first to turn the picture into characters, a step a digital PDF skips straight past. Next it works out the layout and finds where the header sits. It also follows the transaction table onto a second page, where its column headers aren't repeated. Then it compares the layout and wording against known document types. From that, it classifies the file as a bank statement rather than an invoice or a pay stub.

From there the parser pulls out the account number, the statement period and the opening and closing balance as named fields. It joins every transaction row across both pages into one table. It also checks the numbers against each other. A running balance that doesn't add up gets flagged for a person instead of being exported as-is. A page that's too blurry to read gets flagged the same way.

Here is the result on a bank statement: account details, balances and every transaction come back as named fields and one table.

Account
FieldExtracted valueConfidence
Account holderHarbor Street Bakery LLC
Address118 Harbor St, Portland, ME
Bank nameFirst Midwest Bank
Account number•••• 4821
Account typeBusiness checking
Statement period2026-07-01 → 2026-07-31
A parsed bank statement: header fields, balances and each transaction row as structured data, scans included.

Rule-based, AI and LLM parsers

ApproachHow it worksGood forLimits
Rule-basedTemplates, zones, anchors and regex locate each fieldA few stable layoutsEach new layout needs new rules; changes break them
Document AIModels trained per document type find fields and tables by content and layoutMany layouts, scans, multi-page tables, high volumeNeeds models for your document types; test before you commit
LLM-basedA language or vision model reads the page and returns text, markdown or JSONUnusual documents, prototypes, preparing documents for search and RAGCan return plausible wrong values; needs a schema and validation

Production platforms combine them: document AI models for known types, an LLM for a new layout, and rules for validation. Parsing for business data gives you the invoice total, checked and loaded into a system. Parsing for AI search and RAG gives you the whole document as clean text. These are different jobs, so decide which one you're doing first.

Which parsing job are you doing?

For business data from many layouts
A document AI platform with pre-trained models, validation and review, so values arrive checked in your system.
For a few stable, digital layouts
Libraries and rules (pypdf, pdfplumber, PyMuPDF), with OCR such as Tesseract if some files are scanned.
For documents for AI search and RAG
A parser built for LLM pipelines (Docling, LlamaParse, Unstructured or Reducto) that keeps layout, tables and headings as text.

Document parsing software and tools compared

The tools fall into four groups. Docsumo is our product, so it's first: a cloud platform, not a library you run on your own servers. Details for the others come from each vendor's own site or documentation, checked in September 2026.

ToolWhat it doesPricing
Document AI platform1 tool
DocsumoOur productAny business document type, validation rules, review of low-confidence fields, and output by API, webhooks or Excel; cross-document checks on the Enterprise planFree 14-day trial; quoted plans
Cloud document API3 tools
Amazon TextractText, forms, tables, queries, and prebuilt APIs for expenses, IDs and lending documentsTables $15 per 1,000 pages
Google Document AIOCR, Form Parser, the Gemini-based Layout Parser and custom extractorsLayout Parser $10 per 1,000 pages
Azure Document IntelligenceRead, layout, prebuilt and custom modelsLayout $10 per 1,000 pages
Parser for AI and RAG4 tools
ReductoAPI to parse, extract, split and classify documents into JSON with citations and bounding boxesParse $10 per 1,000 pages
LlamaParseLlamaIndex's hosted parser that turns documents in 90+ formats into Markdown and structured dataFree tier; from $50 a month
UnstructuredPlatform and open-source library that partitions 65+ file types into typed elements and chunks10,000 free pages, then $0.015 a page
DoclingOpen-source toolkit that converts PDF, DOCX, HTML and other formats into Markdown or JSON for generative AIFree (MIT)
Open-source library4 tools
pypdfReads text and metadata from digital PDFsFree (BSD)
pdfplumberReads characters with positions, with table extraction for digital PDFsFree (MIT)
PyMuPDFFast PDF text, image and layout extractionAGPL or commercial license
TesseractOCR for scans, called from Python through pytesseractFree (Apache 2.0)

Docsumo reads bank statements, pay stubs, tax forms, ACORD forms and invoices; see Docsumo Document AI. Cloud prices are first-tier list prices and fall at higher volume.

A minimal parser in Python

This minimal example reads a table from a digital PDF with pdfplumber:

import pdfplumber

with pdfplumber.open("statement.pdf") as pdf:
    for page in pdf.pages:
        for table in page.extract_tables():
            for row in table:
                print(row)

This works on clean, digital PDFs with ruled tables. Scans, borderless tables and tables that break across pages need more work. For OCR on scans, see our Tesseract guide.

Document parsing use cases

  • Accounts payable

    Invoice headers and line items for PO matching. See AP automation.
  • Lending

    Bank statements, pay stubs and tax returns for underwriting and income verification.
  • Insurance

    ACORD forms, loss runs and certificates of insurance.
  • Commercial real estate

    Rent rolls and operating statements.
  • Legal and procurement

    Contract dates, parties, renewal terms and clauses.
  • Healthcare

    Intake forms, referrals and claim forms.
  • Knowledge bases and AI assistants

    Policies, manuals and reports parsed for search and RAG.

Build or buy?

Build with libraries when you have a few stable, digital layouts and engineers to maintain the code. Buy a platform when you have many senders, scans, tables that span pages, or values that drive decisions. The hidden cost of building is upkeep: every new layout is more rules. If the parsing has to run inside your own product, Docsumo's document extraction API returns the fields as JSON. It also gives your users a review screen.

Build with libraries

  • You write rules for every layout
  • Scans need an OCR step you tune yourself
  • Validation, review screens and audit trails are yours to build
  • Every format change is a code change

Buy a platform

  • Pre-trained models handle many layouts
  • OCR for scans is built in
  • Validation rules and a review queue come with it
  • New layouts don't need new code
  • 99%field-level accuracy across 250+ document types
  • 95%+of documents processed straight through, without manual review

How to choose a document parser

Vendor sample files are picked to look good. Test on 50 to 100 of your own documents, and agree before you start what counts as a wrong answer.

We'd rather you shopped by results than by label. Document parsing, document AI and intelligent document processing all describe the same job in different words. None of those labels tells you how a tool handles your worst scan. Test candidates on the documents you actually receive, not on the term a vendor puts on its homepage.

  • Test on your own documentsInclude your worst scans, multi-column pages and longest tables.
  • Score field-level accuracy and straight-through rateA parser can return text for every page and still get key fields wrong.
  • Check table handlingMulti-page, borderless and nested tables.
  • Send it a document type you didn't plan forA flag or low confidence score is fine; a confident wrong answer is the dangerous outcome.
  • Check validation and reviewCan you add rules and review exceptions against the source page?
  • Test the whole data pathCheck that the output schema loads into your system, not just that the JSON looks right. See integrations.
  • Model the cost at your real volumePer-page prices that look small at 1,000 pages a month look different at 100,000.
  • Check securitySOC 2 Type 2, HIPAA and GDPR where your data needs them.

Start from the job, not the label

Document parsing rebuilds structure from files that never carried it. Libraries and rules work for a few fixed layouts. Document AI adds validation and review for the many layouts a normal inbox produces. A parser built for RAG keeps a document as text instead of a spreadsheet. For the broader picture, read what is data extraction.

Book a demo to see Docsumo parse your own documents, or start a free trial.

Frequently asked questions

What is document parsing?

Document parsing reads a document and turns its contents into structured data that software can store, search or act on. That data includes key-value fields, tables and ordered text.

What is the difference between document parsing and OCR?

OCR converts an image of text into text. Parsing goes further, working out the layout and structure and which values are which fields. Parsing uses OCR as a step for scanned documents. See IDP vs OCR.

What is the best document parser?

It depends on the job. For fixed layouts, a rule-based parser is enough. For many layouts and scans, use a document AI platform with models for your document types. For turning documents into text for search or RAG, tools like Docling, LlamaParse and Unstructured are built for that.

What is document parsing software?

Document parsing software reads files such as PDFs, scans and Word documents and returns their contents as structured data. It comes in four kinds. Free libraries include pypdf and pdfplumber. Parsers for AI pipelines include Docling, LlamaParse, Unstructured and Reducto. The cloud APIs include Amazon Textract, Google Document AI and Azure Document Intelligence. Document AI platforms such as Docsumo add validation and review.

Can I build my own document parser in Python?

Yes. Libraries like pypdf, pdfplumber and PyMuPDF read digital PDFs, and Tesseract adds OCR for scans. Expect to write and maintain rules for each layout, and to build validation and review yourself.

How accurate is AI document parsing?

It varies by tool and document. Docsumo reports 99% field-level accuracy on 250+ document types. Always test on your own documents, including poor scans.

See Docsumo read your own documents

Bring a few real samples. We'll show the fields extracted, the checks that ran and what a reviewer would see.