Rows and columns kept intact

PDF Table Extraction: Extract Tables from PDFs to Excel, CSV and JSON

Pull table data out of a PDF with the rows and columns aligned, not flattened into one column. DocuOCR reads digital and scanned PDFs, keeps the grid, and exports clean Excel, CSV or JSON.

Free Python libraries only read PDFs that already contain text. For scans and messy layouts you need OCR, and this page shows both. Last updated July 2026.

  • Rows and columns kept aligned
  • Works on scanned PDFs too
  • Export to Excel, CSV or JSON
  • Multi-page tables stay whole
Upload a PDF with a table, no signup

PDF, JPG, PNG, BMP, HEIC, TIFF

Upload a document to extract

See the rows and columns come back structured, even from a scan.

SOC 2 Type II
256-bit encryption
US data handling
Excel, CSV, JSON out
Scans
handled with built-in OCR
3 formats
Excel, CSV and JSON out
0 columns
no flattened, jumbled cells
Multi-page
tables stay whole
// The short answer

How PDF table extraction actually works

Extracting a table from a PDF means detecting the grid, reading each cell, and keeping the rows and columns aligned so the data lands as a real table instead of a wall of text. The right method depends on one question: does the PDF already contain text, or is it a scan? A digital PDF has a text layer, so free Python libraries like Camelot, tabula-py and pdfplumber can pull the table with no OCR. A scanned or photographed PDF is just an image, so those libraries return nothing and you need OCR to read the page first. AI OCR services such as DocuOCR, AWS Textract Tables and Azure Document Intelligence Layout handle scans by recognizing the visual structure of the table, then returning rows and columns you can export to Excel, CSV or JSON. That is why a tool that works on your test file can fail on a scanned one, and why matching the method to the document type matters more than the tool's name.

Match method to file

  • Digital PDF: Camelot or tabula-py, free.
  • Scanned PDF: OCR service, or nothing comes back.
  • Either, at scale: an OCR API to Excel or JSON.
// The gotcha nobody mentions

Why the free Python libraries return nothing on a scan

The most common table-extraction failure is not a jumbled grid, it is an empty result. A developer installs Camelot or tabula-py, runs it on a downloaded bank statement or report, and gets back nothing. The library is not broken. Those tools read the text layer inside a PDF, and a scanned or photographed document has no text layer, only an image of the page. With no characters to parse, they return an empty table.

The fix is to run OCR before extraction. An OCR service reads the characters off the page image, reconstructs the table structure, and hands back rows and columns the same way it would for a native PDF. DocuOCR detects an image-only page automatically and applies OCR, so you send one file type and get one consistent output whether the source was a clean export or a phone photo of a printout.

This is worth checking before you pick a method. If every document you handle is a digital export, the free libraries are excellent and cost nothing. If any of them are scans, faxes or photos, you need OCR in the pipeline, and a service that does both saves you from maintaining two code paths.

Text layer vs image

  • Digital PDF: has selectable text, free libraries work.
  • Scanned PDF: image only, needs OCR to read.
  • Quick test: if you can highlight the text, it is digital.
  • DocuOCR: detects which and handles both.
// Methods, compared

PDF table extraction tools side by side

The free Python libraries and the OCR services solve different halves of the problem. The dividing line is whether the tool can read a scan. Verified July 2026.

Tool Reads scans? Output Best for
DocuOCR Yes (AI OCR) Excel, CSV, JSON with cells kept in order Scanned and digital PDFs, messy layouts, one API
Camelot (Python) No, text PDFs only pandas DataFrame or CSV Lattice tables with clear gridlines
tabula-py (Python) No, text PDFs only pandas DataFrame or CSV Stream tables separated by whitespace
pdfplumber (Python) No, text PDFs only Python lists and dicts Custom parsing of digital PDFs
AWS Textract Tables Yes (OCR) Blocks with row and column indexes Scanned tables on the AWS stack
Azure DI Layout Yes (OCR) Tables with structure and spans Scanned tables on the Azure stack
Google Cloud Vision Yes, but no table grid Text and bounding boxes only Raw text, not structured tables

If you just want a spreadsheet out the other side, converting the PDF to Excel gives you the tables as a clean .xlsx. If you are wiring this into code, the OCR API from Python returns the same table rows as JSON.

// How it works

From a PDF to a clean table in four steps

1. Upload

Drop in a PDF or image. DocuOCR detects whether the page is digital or scanned.

2. Read the page

For a scan it runs OCR; for a digital PDF it reads the text layer directly.

3. Rebuild the grid

AI finds the table, keeps merged cells and multi-line rows aligned, and orders the columns.

4. Export

Download the table as Excel, CSV or JSON, or read it back over the API.

// Where teams use it

Tables that teams pull from PDFs

Bank statements

Turn multi-page transaction tables into rows for reconciliation and bookkeeping.

Invoices and POs

Pull line items, quantities and totals into a table your ERP can import.

Financial reports

Extract figures from annual reports and filings for analysis in a spreadsheet or pandas.

Price lists and catalogs

Convert supplier price tables into structured rows you can compare and load.

Lab and test results

Capture result tables from scanned reports for records and downstream systems.

Shipping and logistics

Read line-item tables off bills of lading and packing lists at volume.

// Frequently asked

PDF table extraction FAQ

How do I extract a table from a PDF?
Upload the PDF to a tool that detects the table, reads each cell, and keeps the rows and columns aligned instead of dumping everything into one column. If the PDF is digital, a Python library like Camelot or tabula-py can pull the grid. If it is scanned, it is an image and needs OCR first. DocuOCR handles both: it detects an image-only page, runs OCR, and exports the table as Excel, CSV or JSON with the structure intact.
What is the best tool to extract tables from a PDF?
The best tool depends on whether the PDF is digital or scanned. For clean digital PDFs, Camelot works well on tables with visible gridlines and tabula-py on tables separated by whitespace, both free in Python. For scanned PDFs, mixed layouts or volume, an AI OCR service returns cleaner grids: DocuOCR, AWS Textract Tables and Azure Document Intelligence Layout all read the table off the page image, while DocuOCR also exports straight to Excel, CSV or JSON.
Can I extract tables from a scanned PDF?
Yes, but only with OCR. A scanned PDF is an image with no text layer, so text-based libraries like Camelot, tabula-py and pdfplumber return nothing. You need a tool that runs optical character recognition on the page first, then reconstructs the table. DocuOCR detects that a page is image-only, applies OCR automatically, and returns the rows and columns as structured data, the same output a native PDF would give.
How do I extract tables from a PDF in Python?
For digital PDFs, install Camelot for tables with gridlines or tabula-py for whitespace-separated tables, and each returns the result as a pandas DataFrame you can export to CSV. For scanned PDFs, call an OCR API instead, because those libraries only read embedded text. DocuOCR is called with plain requests: POST the PDF, read the JSON, and load the table rows into a DataFrame. One code path then covers both scanned and digital files.
How do I extract a table from a PDF to Excel?
Send the PDF to a converter that maps the rows and columns straight into a spreadsheet rather than flattening them into one column. DocuOCR reads the table, keeps a multi-column layout aligned, and exports a clean .xlsx (or CSV or JSON) so a statement or price list comes back as a real grid you can sort, filter and pivot. For scanned files it applies OCR first, which a basic text-copy converter cannot do.
Why does my PDF table come out jumbled or in one column?
It usually happens for one of three reasons: the PDF is scanned and has no text to read, the table has no gridlines so a text tool cannot find its edges, or the tool only dumps raw text instead of detecting cells. AI table extraction fixes all three by recognizing the visual structure of the table, not just the characters. DocuOCR keeps merged cells, multi-line rows and multi-page tables aligned instead of collapsing them.
Which OCR services keep table structure?
AWS Textract Tables, Azure AI Document Intelligence Layout, Google Document AI Form Parser and DocuOCR all return table structure, meaning rows and columns rather than a wall of text. Google Cloud Vision does not: it returns text and bounding boxes but no table grid, so you would rebuild the columns yourself. If keeping the grid intact matters, choose a document-layout service, not a plain text OCR endpoint.
Can I extract tables from a PDF for free?
Yes, for digital PDFs. Camelot, tabula-py and pdfplumber are free Python libraries that read tables from PDFs that already contain text. The catch is that they do not work on scanned or photographed PDFs, which need OCR. DocuOCR offers a free trial with no signup so you can extract tables from scanned files too and see the structured output before you move to a paid per-page plan for volume.
How do I extract tables from thousands of PDFs at once?
Run the extraction as a batch through an API rather than opening files one by one. Post each PDF to a service, add backoff for rate limits, and collect the results as they finish. DocuOCR takes a batch of documents, keeps each table aligned in the output, and returns Excel, CSV or JSON per file, with webhooks so results arrive as jobs complete instead of blocking on each call.

Get the table, not a wall of text

Upload a PDF with a table, scanned or digital, and DocuOCR returns the rows and columns aligned as Excel, CSV or JSON. Try it free with no signup, then scale per page when you go to volume.