---
title: "Document Parsing: How It Works, Software and Tools"
description: "Document parsing turns PDFs, scans and other files into structured data. How parsers work, rule-based vs AI vs LLM parsing, and 12 tools compared."
url: https://www.docsumo.com/blog/document-parsing
updated: 2026-09-28
---

# 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.

[Ritu John](https://www.docsumo.com/blog-authors/ritu-john) · Updated Sep 28, 2026 · 7 min read

![Illustration of a person placing the Docsumo icon into an app window as documents flow in and become charts and data](https://www.docsumo.com/blog/images/data-extraction--document-parsing-hero.webp)

## 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.

**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](https://www.docsumo.com/blog/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: 01 Get the text, 02 Analyze the layout, 03 Classify, 04 Extract fields and tables, 05 Validate → **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**

| Field | Extracted value |
| --- | --- |
| Account holder | Harbor Street Bakery LLC |
| Address | 118 Harbor St, Portland, ME |
| Bank name | First Midwest Bank |
| Account number | •••• 4821 |
| Account type | Business checking |
| Statement period | 2026-07-01 → 2026-07-31 |

**Balances**

| Field | Extracted value |
| --- | --- |
| Opening balance | 42,180.55 |
| Total deposits | 88,412.10 |
| Total withdrawals | 91,686.44 |
| Closing balance | 38,906.21 |
| Transaction count | 142 |

**Transactions**

| Field | Extracted value |
| --- | --- |
| Date | 2026-07-14 |
| Description | ACH DEPOSIT STRIPE PAYOUT |
| Amount | +3,284.10 |
| Debit / credit | Credit |
| Running balance | 51,902.44 |
| Category | Card processor payout |

*A parsed bank statement: header fields, balances and each transaction row as structured data, scans included.*

## Rule-based, AI and LLM parsers

| Approach | How it works | Good for | Limits |
| --- | --- | --- | --- |
| Rule-based | Templates, zones, anchors and regex locate each field | A few stable layouts | Each new layout needs new rules; changes break them |
| Document AI | Models trained per document type find fields and tables by content and layout | Many layouts, scans, multi-page tables, high volume | Needs models for your document types; test before you commit |
| LLM-based | A language or vision model reads the page and returns text, markdown or JSON | Unusual documents, prototypes, preparing documents for search and RAG | Can 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?**

- **Business data from many layouts**: A **document AI platform** with pre-trained models, validation and review, so values arrive checked in your system.
- **A few stable, digital layouts**: **Libraries and rules** (pypdf, pdfplumber, PyMuPDF), with OCR such as Tesseract if some files are scanned.
- **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.

**Document AI platform** (1 tool)

| Tool | What it does | Pricing |
| --- | --- | --- |
| Docsumo (Our product) | Any business document type, validation rules, review of low-confidence fields, and output by API, webhooks or Excel; cross-document checks on the Enterprise plan | Free 14-day trial; quoted plans |

**Cloud document API** (3 tools)

| Tool | What it does | Pricing |
| --- | --- | --- |
| Amazon Textract | Text, forms, tables, queries, and prebuilt APIs for expenses, IDs and lending documents | Tables $15 per 1,000 pages |
| Google Document AI | OCR, Form Parser, the Gemini-based Layout Parser and custom extractors | Layout Parser $10 per 1,000 pages |
| Azure Document Intelligence | Read, layout, prebuilt and custom models | Layout $10 per 1,000 pages |

**Parser for AI and RAG** (4 tools)

| Tool | What it does | Pricing |
| --- | --- | --- |
| Reducto | API to parse, extract, split and classify documents into JSON with citations and bounding boxes | Parse $10 per 1,000 pages |
| LlamaParse | LlamaIndex's hosted parser that turns documents in 90+ formats into Markdown and structured data | Free tier; from $50 a month |
| Unstructured | Platform and open-source library that partitions 65+ file types into typed elements and chunks | 10,000 free pages, then $0.015 a page |
| Docling | Open-source toolkit that converts PDF, DOCX, HTML and other formats into Markdown or JSON for generative AI | Free (MIT) |

**Open-source library** (4 tools)

| Tool | What it does | Pricing |
| --- | --- | --- |
| pypdf | Reads text and metadata from digital PDFs | Free (BSD) |
| pdfplumber | Reads characters with positions, with table extraction for digital PDFs | Free (MIT) |
| PyMuPDF | Fast PDF text, image and layout extraction | AGPL or commercial license |
| Tesseract | OCR for scans, called from Python through pytesseract | Free (Apache 2.0) |

Docsumo reads [bank statements](https://www.docsumo.com/solutions/documents/bank-statements), pay stubs, tax forms, ACORD forms and [invoices](https://www.docsumo.com/solutions/documents/invoices); see [Docsumo Document AI](https://www.docsumo.com/platform#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:

```python
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](https://www.docsumo.com/blog/tesseract-ocr).

## Document parsing use cases

### Accounts payable

Invoice headers and line items for PO matching. See [AP automation](https://www.docsumo.com/solutions/use-cases/accounts-payable).

### Lending

Bank statements, pay stubs and tax returns for underwriting and [income verification](https://www.docsumo.com/solutions/use-cases/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.

> **Docsumo for this**: [Document extraction API](https://www.docsumo.com/solutions/document-extraction-api)
>
> Send files through the REST API and get JSON back, with a confidence score on every field and a white-label review screen for the unsure ones.

## 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](https://www.docsumo.com/solutions/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 documents**: Include your worst scans, multi-column pages and longest tables.
- **Score field-level accuracy and straight-through rate**: A parser can return text for every page and still get key fields wrong.
- **Check table handling**: Multi-page, borderless and nested tables.
- **Send it a document type you didn't plan for**: A flag or low confidence score is fine; a confident wrong answer is the dangerous outcome.
- **Check validation and review**: Can you add rules and review exceptions against the source page?
- **Test the whole data path**: Check that the output schema loads into your system, not just that the JSON looks right. See [integrations](https://www.docsumo.com/integrations).
- **Model the cost at your real volume**: Per-page prices that look small at 1,000 pages a month look different at 100,000.
- **Check security**: SOC 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](https://www.docsumo.com/blog/what-is-data-extraction).

[Book a demo](https://www.docsumo.com/book-a-demo) to see Docsumo parse your own documents, or [start a free trial](https://www.docsumo.com/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](https://www.docsumo.com/blog/intelligent-document-processing-vs-optical-character-recognition).

### 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.

**Sources**

1. [pdfplumber on PyPI](https://pypi.org/project/pdfplumber/)
2. [pypdf on PyPI](https://pypi.org/project/pypdf/)
3. [Docling on GitHub](https://github.com/docling-project/docling)
4. [LlamaParse documentation](https://developers.llamaindex.ai/llamaparse/parse/)
5. [Unstructured on GitHub](https://github.com/Unstructured-IO/unstructured)
6. [AWS: Amazon Textract features](https://aws.amazon.com/textract/features/)
7. [AWS: Amazon Textract pricing](https://aws.amazon.com/textract/pricing/)
8. [Google Cloud: Document AI pricing](https://cloud.google.com/products/document-ai/pricing)
9. [Microsoft: Azure Document Intelligence pricing](https://azure.microsoft.com/en-us/pricing/details/document-intelligence/)
10. [LlamaIndex: pricing](https://www.llamaindex.ai/pricing)
11. [Unstructured: pricing](https://unstructured.io/pricing)
12. [Reducto: pricing](https://reducto.ai/pricing)
13. [PyMuPDF on PyPI](https://pypi.org/project/pymupdf/)

First published Feb 8, 2024. Last updated Sep 28, 2026.

**Written by** [Ritu John](https://www.docsumo.com/blog-authors/ritu-john) · Digital Content Expert, Docsumo

Ritu is a seasoned writer and digital content creator with a passion for exploring the intersection of innovation and human experience. As a writer, her work spans various domains, making content relatable and understandable for a wide audience.

[LinkedIn](https://www.linkedin.com/in/ritujohn) · [All posts by Ritu](https://www.docsumo.com/blog-authors/ritu-john)

- [AI bank statement analysis: how it works and what you get from it](https://www.docsumo.com/blog/ai-bank-statement-analysis)
- [ACORD 25 data extraction: fields, checks and automation](https://www.docsumo.com/blog/acord-25-data-extraction)
- [What is file parsing? Techniques, tools and Python examples](https://www.docsumo.com/blog/file-parsing)

## Keep reading

- [Data parsing: what it is, how it works and the main techniques](https://www.docsumo.com/blog/data-parsing): For data, operations and IT teams: a plain explanation of data parsing, the techniques from regex to machine learning, where each one fits, and what changes when the data is inside PDFs and scans.
- [What is file parsing? Techniques, tools and Python examples](https://www.docsumo.com/blog/file-parsing): For developers, data engineers and operations teams. What file parsing is, how to parse common formats with working Python code, where it breaks, and what to use for scans.
- [What is document AI? How it works, what it's used for, and how to choose](https://www.docsumo.com/blog/what-is-document-ai): Written for teams weighing document AI tools. Follow one pay stub through the process, then test vendors with a checklist built around your own files.

[More on OCR & IDP](https://www.docsumo.com/blog#posts-idp)

## Next steps

- [Book a demo](https://www.docsumo.com/book-a-demo)
- [Get a free trial (1,000 pages)](https://www.docsumo.com/free-trial)
- [Contact sales or support](https://www.docsumo.com/contact)
- [agents.md](https://www.docsumo.com/agents.md): connect Docsumo to your AI agent with Docsumo MCP
- [llms.txt](https://www.docsumo.com/llms.txt) lists the key pages; add .md to any page's URL for its Markdown copy
