Est.

Guide

PDF Data Extraction: Six Ways to Get Data Out of PDFs, and Which Fits Yours

Six ways to extract data from PDFs, the kind of PDF each one handles, and the failures to test for before you trust the output.

Infrastructure vs. Models · Reviewed November 25, 2026 · Document Infrastructure Review Editors

PDF data extraction means turning the contents of a PDF, such as invoice totals, statement line items, contract clauses or the rows of a table, into structured data a spreadsheet, database or AI agent can use. It is harder than it looks because a PDF records where characters are drawn on a page, not what they mean: there are no rows, fields or paragraphs in the file, only positioned glyphs, and in a scanned PDF not even those, just a picture of the page.

So the right tool depends first on the PDFs you have. A clean report exported from accounting software, a phone photo of a receipt and a 200-page loan file need different methods. This guide sets out six ways to extract data from PDFs, who each is best for and where each breaks, then a test to run on your own files. It names example tools but does not rank them or quote prices, which change often; check each project's documentation or vendor's pricing page before you choose.

Six ways to extract data from PDFs, and who each is best for

  1. PDF text and table libraries: best for developers pulling text or simple tables from digitally created PDFs whose layout does not change.
  2. OCR engines: best for turning scanned or photographed pages into searchable text, where you need the words rather than structured fields.
  3. Open-source layout-aware parsers: best for teams with engineering and GPU capacity who need mixed or complex PDFs converted to structured text on their own hardware, for example to feed a retrieval (RAG) pipeline.
  4. Cloud providers' document APIs: best for engineering teams on one cloud who want OCR, form and table extraction as managed APIs inside that account.
  5. API-first document processing platforms: best for teams building products or AI agents that need specific fields from varied, messy PDFs returned as validated JSON, without building the pipeline around the model themselves.
  6. General-purpose LLMs and vision-language models: best for prototypes, one-off jobs and low volumes of varied PDFs, where a person checks the output.

01

PDF text and table libraries

Best for: Developers pulling text or simple tables from digitally created PDFs whose layout does not change.

Code libraries that read the text layer a PDF already contains, with the position of every word, and rebuild lines and tables from those positions. They are fast, run anywhere and cost nothing to license.

Examples: PyMuPDF, pdfplumber, Camelot, Tabula, Apache Tika.

Watch for: They read only what the file exposes: a scanned page has no text layer, so they return little or nothing without OCR first. Rules tuned to one layout break silently when a sender changes theirs, and tables without ruling lines, merged cells and tables that run across pages are where output goes wrong. Our comparison of open-source and commercial extraction covers where each library stops.

Check before you shortlist: Whether your PDFs have a text layer at all, each library's licence, and whether its table mode handles tables with and without ruling lines.

02

OCR engines

Best for: Turning scanned or photographed pages into searchable text, where you need the words rather than structured fields.

Engines that recognise characters in an image of a page and return text with its position, which other tools can then structure.

Examples: Tesseract, PaddleOCR.

Watch for: OCR returns text, not tables or fields: reading order across columns, table structure and which value belongs to which label are left to you. Accuracy drops on low-resolution scans, skewed pages, unusual fonts and handwriting unless the images are cleaned up first. See scanned invoice failure modes, and our OCR API guide for hosted options.

Check before you shortlist: Support for the languages and scripts in your documents, and the image preprocessing each project's documentation recommends.

03

Open-source layout-aware parsers

Best for: Teams with engineering and GPU capacity who need mixed or complex PDFs converted to structured text on their own hardware, for example to feed a retrieval (RAG) pipeline.

Toolkits and open-weight models that detect a page's layout (headings, columns, tables, figures) and its reading order, then export Markdown, HTML or JSON, using OCR where a page has no text layer.

Examples: Docling (IBM Research), MinerU, PaddleOCR's document parsing pipelines.

Watch for: They parse documents; they do not fill your schema. Pulling specific fields, checking them and routing doubtful ones to a person is still your work, and so is hosting, evaluation and upkeep. Strong benchmark scores can hide failures on large or borderless tables, as our table extraction comparison for scanned PDFs explains.

Check before you shortlist: The licence of each model you would ship, hardware requirements, and output on your hardest pages rather than the project's examples.

04

Cloud providers' document APIs

Best for: Engineering teams on one cloud who want OCR, form and table extraction as managed APIs inside that account.

Hosted services that return text, key-value pairs and tables from PDFs and images, with pre-built models for common documents such as invoices, receipts and identity documents, and options to train custom ones.

Examples: Amazon Textract, Google Cloud Document AI, Azure AI Document Intelligence.

Watch for: They return building blocks. Mapping key-value pairs to your schema, splitting multi-document PDFs, confidence routing and review are usually yours to build, and many document types can mean many separate processors. See switching from Google Document AI.

Check before you shortlist: Per-page pricing on each provider's pricing page, which pre-built models exist for your document types, and which regions they run in.

05

API-first document processing platforms

Best for: Teams building products or AI agents that need specific fields from varied, messy PDFs returned as validated JSON, without building the pipeline around the model themselves.

Developer platforms that take a PDF and a schema and return structured data, with parsing, splitting, classification and extraction exposed as APIs and SDKs. Extend, for example, offers APIs for parsing, extraction, splitting, classification and workflow orchestration, with SDKs in Python, TypeScript, Java and Go.

Examples: Extend, Reducto, LlamaParse.

Watch for: Some stop at turning PDFs into text or Markdown; others extract to your schema and add confidence scores, review and orchestration. Ask which layers you would still build, whether every row of a long table comes back (see silent row dropping), and how confidence scores are calibrated.

Check before you shortlist: Deployment options, data retention terms, certifications, and pricing at your monthly page volume, on each vendor's own site.

06

General-purpose LLMs and vision-language models

Best for: Prototypes, one-off jobs and low volumes of varied PDFs, where a person checks the output.

Sending the PDF, or images of its pages, to a large model with a prompt or a JSON schema and asking for the fields you need.

Examples: OpenAI GPT models, Anthropic Claude, Google Gemini.

Watch for: Output can be well-formed and still wrong: plausible values that are not on the page, rows missing from long tables, and results that change when the provider updates the model. Long PDFs may exceed what one request can take. See why vision-language models are not enough and specialist document AI vs general-purpose LLM APIs.

Check before you shortlist: File and page limits in each provider's API documentation, whether you can pin a model version, and the provider's data retention terms.

First, find out what kind of PDFs you have

Most failed PDF extraction projects picked a tool before looking at the documents. Sort a sample of your files into the groups below; the mix tells you which of the six methods are worth testing.

  • Digitally created PDFs. Exported from software, with a text layer you can select and copy in a PDF viewer. Libraries can read these directly.
  • Scanned or photographed PDFs. Each page is an image; selecting text selects nothing. These need OCR or a vision model before anything else.
  • Mixed PDFs. Some pages have text and some are scans, or a scan carries an OCR layer of doubtful quality. Check page by page, not file by file.
  • Fixed layouts or many layouts. One form from one sender can run on rules. Invoices from hundreds of suppliers cannot: see layout edge cases that break production parsers.
  • One document per file, or packets. A single PDF often holds several documents, such as a loan file or a claims bundle, which must be split before extraction. See document splitting strategy.

Where PDF data extraction goes wrong

The failures that cost most are the quiet ones: the output looks complete and is not. Test for each of these on purpose.

  • Reading order. In multi-column pages, a simple top-to-bottom sort splices one column into another, and captions or side notes land in the wrong place. See reading order reconstruction.
  • Table structure. Merged cells, headers printed only on a table's first page, sub-headers inside a table and totals rows are common causes of shifted or misattributed values. See how parsers fail complex tables.
  • Missing rows. Long line-item lists can come back as valid output with rows left out. Count rows against the source, as our piece on silent row dropping describes.
  • Handwriting and annotations. Handwritten notes, ticks and stamps over printed forms defeat tools built for printed text. See handwriting, nested tables and multi-page forms.
  • Schema mismatch. Text in the right order is still not data until it is mapped to fields with types and rules. See structured output schema design.

How to test a PDF extraction tool on your own files

Published benchmarks rarely look like your documents. Put every tool you are considering through the same test, and decide what passing means before you see results.

  1. Collect 50 to 200 real PDFs, weighted toward the hard ones: poor scans, rotated pages, multi-column pages, long tables and tables that run across pages.
  2. Write down the fields you need, with their types, and record the correct value for each document by hand.
  3. Run every tool on the same files and score each field: right, wrong or missing. Count table rows separately from values.
  4. Run the same files again and compare, so you know whether the output is repeatable.
  5. Where a tool gives confidence scores, check whether high-confidence fields are in fact more often right.
  6. Note the code you had to write around each tool, such as OCR, splitting and mapping to your schema, and what it would cost to keep running at your monthly volume.

Frequently asked questions

Can you extract data from a scanned PDF?

Yes, but not with a library that only reads the text layer, because a scanned page is an image. Use an OCR engine, a layout-aware parser, a cloud document API or a document processing platform, and test on your worst scans, since accuracy falls with resolution, skew and handwriting.

How do I extract a table from a PDF into Excel?

For an occasional, digitally created PDF, desktop tools can do it: Adobe Acrobat can export a PDF to Excel, and Excel for Microsoft 365 on Windows can import tables from a PDF through Get Data. Check the result against the source, especially merged cells and tables that continue across pages. For many files or scanned ones, use one of the methods above and write the output to a spreadsheet.

Can ChatGPT or another LLM extract data from PDFs?

For a few documents with a person checking the result, often yes. At volume, general-purpose models can return values that are not on the page, drop rows from long tables and change behaviour when the model is updated. See specialist document AI vs general-purpose LLM APIs.

What is the difference between PDF parsing and data extraction?

Parsing turns a PDF into structured text: headings, paragraphs and tables in reading order, often as Markdown or JSON. Extraction goes further and fills a schema you define, such as invoice number, date and line items, with types you can validate. Many tools do only the first.

Is there a free way to extract data from PDFs?

Open-source libraries, OCR engines and layout parsers cost nothing to license, but you pay in hosting, engineering time and upkeep. Our total cost of ownership piece and build versus buy guide set out when that trade pays.

Should I use PDF data extraction software or intelligent document processing?

They overlap. If people review documents on screen inside a workflow, see our intelligent document processing software guide. If code or an agent consumes the output, start with the methods on this page.

Further reading