Extract tables from a PDF into CSV

Most "PDF to CSV" tools dump raw text and leave you to re-build the columns by hand. PDFjet finds the actual table structure — even in scanned invoices and multi-page reports — and returns clean, comma-separated rows with one API call. Here's how.

TL;DRPOST https://pdfjet.dev/extract/csv with your PDF as the file field. You get CSV back. Grab a free API key (100 pages/month, no card).

1. The one-line version (curl)

curl -X POST https://pdfjet.dev/extract/csv \
  -H "Authorization: Bearer pj_live_..." \
  -F [email protected] \
  -o tables.csv

2. Python

import requests

with open("invoice.pdf", "rb") as f:
    r = requests.post(
        "https://pdfjet.dev/extract/csv",
        headers={"Authorization": "Bearer pj_live_..."},
        files={"file": f},
    )
open("tables.csv", "wb").write(r.content)

3. Node.js

const fd = new FormData();
fd.append("file", new Blob([await fs.readFile("invoice.pdf")]), "invoice.pdf");

const res = await fetch("https://pdfjet.dev/extract/csv", {
  method: "POST",
  headers: { Authorization: "Bearer pj_live_..." },
  body: fd,
});
await fs.writeFile("tables.csv", Buffer.from(await res.arrayBuffer()));

Scanned invoice? It still works.

If the PDF is a scan (image-only, no text layer), PDFjet detects that, runs OCR, and reconstructs the grid before returning CSV — so you don't need a separate OCR step. Multi-page tables are stitched into one CSV with a single header row.

Want to see it before writing any code? Drop a PDF into the free tool and preview the CSV instantly — no signup.

FAQ

Can I extract tables from a scanned PDF?

Yes — scanned pages are OCR'd and the table structure is rebuilt automatically.

Does it handle multi-page tables?

Yes — rows spanning pages are merged into one CSV.

Are my files stored?

No — processing is stateless; files are never stored or used to train models.

Turn your PDFs into CSV in minutes

Free tier: 100 pages/month. No credit card.

Get your free API key →

Related guides