Extract tables from PDF with a table extraction API

Nutrient Data Extraction API pulls tables out of PDFs and scans with their structure intact. It returns every table as JSON, with each cell’s row, column, merged-cell span, and position on the page. Need a spreadsheet? Nutrient DWS Processor API returns an Excel workbook ready for formulas.


Used by Lufthansa, Disney, Autodesk, UBS, Dropbox, IBM
Lufthansa
Disney
Autodesk
UBS
Dropbox
IBM

Try it live

See extracted tables on a sample document

Pick a sample document, such as the invoice, and compare the extracted tables with the original page. To run it on your own PDF, open Parse Studio (a temporary workspace needs no signup).


Excel for spreadsheets, JSON for code

The Processor API turns a PDF page into an Excel workbook, with rows and columns preserved. For code, ETL, and LLM pipelines, Nutrient’s Data Extraction API returns each table as JSON with merged-cell spans and a confidence score on every cell. Already using the Processor API’s JSON output? It keeps working.

Merged cells and headers kept

The Data Extraction API marks header cells and records each cell’s row and column span, so a two-level header rebuilds exactly as printed. Rows that wrap onto several lines stay together as one row when detected, and the table’s caption and footnotes are linked to it by ID. Every cell carries a confidence score, so low-confidence cells can go to review before the data moves on.

PDFs and scans

Scanned and image-only PDFs go through OCR before the tables are read. In the Processor API, an OCR action in the same request runs before the Excel conversion, and the JSON output runs OCR as part of extraction. In the Data Extraction API, understand mode reads scanned tables with AI-augmented OCR.

Choose the output

Three routes to a table

01

Data Extraction JSON

Returns table elements with merged-cell spans, header flags, and a confidence score on every cell, from the Data Extraction API in understand mode. Save a PDF as document.pdf and run the sample from the same folder: Python and JavaScript print each table as rows, and curl saves the full response to result.json. Free plan: $5 of usage every month.

Every element: PDF-to-JSON API
curl -X POST https://api.nutrient.io/extraction/parse \
-H "Authorization: Bearer your_api_key_goes_here" \
-F "file=@document.pdf" \
-F 'instructions={"mode":"understand","output":{"format":"spatial"}}' \
-o result.json

02

Processor JSON

Returns tables with cells, header flags, positions, and the ruling lines drawn on the page. Add a PDF named document.pdf to your project folder, run the code from the same folder, and open result.json. Free plan: $5 of usage every month.

Get the Postman collection
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer your_api_key_here" \
-o result.json \
--fail \
-F document=@document.pdf \
-F instructions='{
"parts": [
{
"file": "document"
}
],
"output": {
"type": "json-content",
"plainText": false,
"structuredText": false,
"keyValuePairs": false,
"tables": true
}
}'

03

Excel (XLSX)

Returns an XLSX workbook with rows and columns preserved. Add a PDF file named document.pdf to your project folder, run the code from the same folder, and open result.xlsx. Free plan: $5 of usage every month.

Explore the PDF-to-Excel API
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer your_api_key_here" \
-o result.xlsx \
--fail \
-F document=@document.pdf \
-F instructions='{
"parts": [
{
"file": "document"
}
],
"output": {
"type": "xlsx"
}
}'

Three steps

How to extract tables from PDF

Every route takes a PDF and returns its tables in one request.

Get an API key

Sign up for a free Nutrient account and copy an API key from the dashboard. New accounts start free with $5 of usage every month, with no credit card required. The same balance covers the Data Extraction API and the Processor API, which runs Excel and Processor JSON.


Pick the route

Choose Excel for a spreadsheet, Processor JSON for tables alongside the page text, or Data Extraction JSON for merged cells, confidence scores, and Markdown output.


Post the PDF and read the tables

Send one REST request with the PDF. Excel comes back as an XLSX file; JSON comes back with each table’s rows, columns, and cells.


Tables in Markdown for LLM and RAG pipelines

Request Markdown output from the Data Extraction API, and tables come back as HTML tables inside the Markdown, with merged cells kept as rowspan and colspan. The result is ready for an LLM prompt, a RAG index, a knowledge base, or as context for agents, without a conversion step.

Choose a processing mode

The text mode ($0.001/page) reads born-digital PDFs without OCR and returns plain text only, no table elements. The structure mode ($0.0015/page) adds OCR but can miss complex table structure. The understand mode ($0.009/page) is recommended for tables. See processing modes for how to choose.

Extract tables from PDF in Python

Every example on this page includes a Python tab, so table extraction drops into a Python service using the standard requests library, with no SDK to install. Teams that need table extraction to run on their own infrastructure rather than the cloud API can use the Python SDK for PDF table extraction instead.


Security is our top priority

SOC 2 Type 2 audited

Nutrient’s infrastructure is SOC 2 Type 2 audited and GDPR compliant. See our privacy policy and security documentation for details on data handling.

HTTPS encryption

All communication between your application and Nutrient is done via HTTPS to ensure your data is encrypted when it’s sent to us.

Safe payment processing

All payments are handled by Paddle. Nutrient DWS Processor API never has direct access to any of your payment data.

Data Extraction API

Extract tables from any PDF or scan

Start free with $5 of usage every month, no credit card.

Every table includes:

    • Merged-cell spans and header flags
    • A confidence score on every cell
    • JSON or Markdown output

Frequently asked questions

What is the PDF table extraction API?

PDF table extraction finds the tables in a document and returns their rows, columns, and cells as structured data, instead of a flat run of text. Nutrient offers two kinds. The Processor API converts PDF tables into an Excel (XLSX) workbook or returns them as JSON with cells, header flags, and positions. The Data Extraction API returns each table as a structured element with rows, columns, cells, merged-cell spans, coordinates, and confidence scores, for code, ETL, and LLM pipelines.

Which output formats can I extract PDF tables to?

Nutrient extracts PDF tables to Excel (XLSX) and JSON with the Processor API, and to JSON and Markdown with the Data Extraction API. CSV and XML output are in development. If you’re interested, join the waitlist on the PDF-to-CSV and PDF-to-XML pages.

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

Nutrient’s table extraction API does it in one REST request. Send the PDF to the Processor API over REST and request the structured output you need. Ready-to-use examples are available in JavaScript, Python, Java, PHP, and HTTP (curl) to get a first request running quickly. For merged cells and a confidence score on every cell, send it to the Data Extraction API’s /extraction/parse endpoint in understand mode instead.

Can I convert PDF tables to Excel?

Yes. Nutrient’s Processor API converts PDF tables to Excel. The PDF-to-Excel API output returns an XLSX file with rows and columns preserved, ready for spreadsheets, reporting, and further processing.

Does table extraction work on scanned PDFs?

Yes. Nutrient runs OCR on scanned tables before reading them. In the Processor API, add an OCR action to the request so the text in page images is recognized before the tables convert to Excel; the JSON output runs OCR as part of extraction. The Data Extraction API runs OCR in understand mode and returns scanned tables as table elements, with a confidence score for each cell.

Open source tools need more setup: Tabula reads only PDFs that already have a text layer, and Camelot’s built-in parsers need a text layer too, with scans handled only through an optional OCR add-on.

Does it handle merged cells and multi-row headers?

Yes. Nutrient’s Data Extraction API returns each cell with rowSpan and colSpan values and flags header cells with isHeader, so merged cells and two-level headers rebuild as printed. Each table links to its caption and footnotes through captionIds and footnoteIds, and rows that wrap onto several lines are kept together as one row when detected.

Do I need Microsoft Office or any local installation?

No. Extraction runs server-side through the cloud API with no Microsoft Office license or local install required, so it fits headless and containerized workflows.

Is there a free tier, and how is it priced?

Yes. Nutrient’s free plan includes $5 of usage every month with no credit card required, and understand mode, which is recommended for tables, costs $0.009 per page. Excel and Processor JSON run on the Processor API, paid from the same balance at its own rates. See API pricing and API pricing for details.

Ready to try it?

Create an account to get your Data Extraction API key and start making API calls.