Document parsing: how it works, methods, software and tools
For operations, finance and engineering teams: what document parsing is, the steps from file to structured data, how rule-based, AI and LLM parsers compare, the tools available, and how to choose.

Key takeaways
- Document parsing is converting a document, such as a PDF, scan, Word file or email, into structured data: 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 for fixed layouts, AI and document AI parsers for varied layouts, and LLM-based parsers that turn documents into clean text or JSON.
- Parsing for business data (the total on an invoice) and parsing for AI search and RAG (a PDF as clean markdown) 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
Document parsing is the process of turning a document, such as a PDF, a scan, a Word file or an email, into structured data that software can use: named fields, tables and text in the right reading order. A parser reads the file, works out its layout, finds the values you need, such as the invoice number or every transaction on a statement, and 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
- 01Get the text
- 02Analyze the layout
- 03Classify
- 04Extract fields and tables
- 05Validate
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, finding where the header sits and following the transaction table as it continues onto a second page without repeating its column headers. Then it compares the layout and wording against known types and 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, and joins every transaction row across both pages into one table. It also checks the numbers against each other, so a running balance that doesn't foot, or a page that's too blurry to read, gets flagged for a person instead of exported as-is.
Here is the result on a bank statement: account details, balances and every transaction come back as named fields and one table.
| Field | Extracted value | Confidence |
|---|---|---|
| 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 |
| Field | Extracted value | Confidence |
|---|---|---|
| Opening balance | 42,180.55 | |
| Total deposits | 88,412.10 | |
| Total withdrawals | 91,686.44 | |
| Closing balance | 38,906.21 | |
| Transaction count | 142 |
| Field | Extracted value | Confidence |
|---|---|---|
| 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 |
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 (the invoice total, checked and loaded into a system) and parsing for AI search and RAG (the whole document as clean text) are different jobs, so decide which one you're doing first.
Which parsing job are you doing?
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.
| Tool | What it does | Pricing |
|---|---|---|
| Document AI platform1 tool | ||
| DocsumoOur 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 API3 tools | ||
| 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 RAG4 tools | ||
| 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 library4 tools | ||
| 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, 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
A minimal table read 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 and 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, and 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 is the process of reading a document and turning its contents into structured data, such as key-value fields, tables and ordered text, that software can store, search or act on.
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 ranges from free libraries (pypdf, pdfplumber) and parsers for AI pipelines (Docling, LlamaParse, Unstructured, Reducto) to cloud APIs (Amazon Textract, Google Document AI, Azure Document Intelligence) and document AI platforms such as Docsumo that 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
- pdfplumber on PyPI
- pypdf on PyPI
- Docling on GitHub
- LlamaParse documentation
- Unstructured on GitHub
- AWS: Amazon Textract features
- AWS: Amazon Textract pricing
- Google Cloud: Document AI pricing
- Microsoft: Azure Document Intelligence pricing
- LlamaIndex: pricing
- Unstructured: pricing
- Reducto: pricing
- PyMuPDF on PyPI
First published . Last updated .