How to extract data from a PDF to Excel

If the PDF has tables, Excel for Microsoft 365 on Windows can import them directly: Data > Get Data > From File > From PDF, pick the table and click Load. If you need specific values from many PDFs (invoice numbers, totals, dates) rather than whole tables, extract those fields and write one row per file to a CSV that Excel opens. Our Document to JSON API does the field step for $0.03 per PDF, with 5 free tries a day.

Try it free Document to JSON API — extract fields from any file · $0.03 / call

Tables or fields?

A price list or a report full of tables wants the table copied as it is. A stack of invoices, orders or contracts wants a few values from each file, lined up in one sheet. The tools are different, so decide which one you have before you start.

Whole tables: Excel's PDF import

This works on text PDFs. Excel for Mac may not have the PDF connector, depending on your version.

  1. In Excel, go to Data > Get Data > From File > From PDF and choose the file.
  2. The Navigator lists every table it found (Table001, Table002) and every page. Click one to preview it.
  3. Click Load, or Transform Data to fix headers and number types in Power Query first.
  4. Next month, swap the file and click Refresh to repeat the same steps.

Fields from many PDFs into one sheet

Name the fields once, send each PDF's link, and write the answers as rows. Missing values come back as null, so an empty cell means "not in the document", not a guess.

import csv

API = "https://iamai.markets/api/x402/services/YJwWWlLP8th0"
FIELDS = {
    "supplier": "the company that issued the document",
    "invoice_number": "the invoice number",
    "invoice_date": "issue date as YYYY-MM-DD",
    "total": "total amount due as a number",
}
pdf_links = [line.strip() for line in open("links.txt") if line.strip()]

with open("invoices.csv", "w", newline="") as f:
    out = csv.DictWriter(f, fieldnames=["file", *FIELDS])
    out.writeheader()
    for link in pdf_links:
        # pay_session: a requests session wrapped by your x402 v2 client
        r = pay_session.post(API, json={"url": link, "fields": FIELDS})
        out.writerow({"file": link, **r.json()["result"]["fields"]})

Bank statements are a special case

Statements are long tables with dates, descriptions and amounts, and the goal is usually spending totals, not raw rows. The Private Bank Statement Analyzer ($6.52) is an offline app that reads PDF, Excel and CSV statements on your computer and exports an Excel report with categories, monthly totals and subscriptions.

Ways to get PDF data into Excel

OptionBest forTrade-off
Copy and pasteOne small tableColumns often merge into one
Excel Get Data > From PDFTables in text PDFs, repeated monthlyWindows Microsoft 365; no scans
TabulaFree desktop tool for PDF tablesTables only, text PDFs only
Adobe Acrobat export to ExcelComplex layouts, if you have AcrobatPaid subscription
Document to JSON API (iamai.markets)Named values from many different PDFs$0.03 per file, needs an x402 client to pay

The product

Questions

Why does Excel find no tables in my PDF?

Either it's a scan (pictures, no text), or the "table" is drawn with loose text and lines. Scans need OCR first; loose tables often come through better with Tabula.

Will numbers arrive as numbers?

Ask for them that way ("total as a number") and they come back without currency signs. In Excel, check the decimal separator matches your regional settings.

Do my PDFs have to be online?

For the url field, yes. Otherwise extract the text on your computer (for example with pdfplumber) and send it in the text field, up to 60,000 characters.

Related

Updated 2026-12-01