Convert a PDF table to CSV

Converting a PDF table to CSV reconstructs rows and columns from the page's positioned text: text items that share a y-position are clustered into rows, and horizontal gaps wider than a threshold split each row into columns. This page runs that reconstruction in your browser with an adjustable gap threshold, and outputs a standard comma-separated file. It works best on simple, visually aligned tables, and the PDF is never uploaded.

PDF to CSV — runs on your device

How it works

A PDF has no concept of a table. What looks like a grid on screen is stored as loose text items — each a fragment of text with x/y coordinates on the page — plus, sometimes, unrelated ruled lines drawn separately. Converting to CSV therefore means reconstructing the grid from geometry alone. The tool extracts every text item with its coordinates, then clusters items whose baselines fall within a small vertical tolerance of one another: each cluster is one row. The tolerance absorbs sub-point jitter that PDF generators introduce, so a row stays one row even when its cells were emitted at fractionally different heights.

Within each row, the items are sorted by x-coordinate and the horizontal gaps between consecutive items are measured. A gap wider than the column threshold ends one cell and starts the next; narrower gaps are treated as spaces within the same cell. That threshold is the tool's one knob, and it matters: too high and adjacent columns fuse, too low and multi-word cells shatter into extra columns. The default suits typical report spacing, and the preview updates as you adjust it, so you can tune by eye before downloading. Finally the cells are serialized as CSV, with quoting applied to any cell containing commas, quotes, or newlines.

This geometric method is honest about its scope: it handles simple, visually aligned tables — one line per cell, consistent column positions — and nothing fancier. Merged cells, cells that wrap onto multiple lines, and stacked header rows violate the one-row-one-line assumption and will come out misaligned. Scanned pages contain no text items at all, so they produce an empty result. For those harder cases, the PDF to Excel guide covers heavier extraction methods; for grabbing the raw text without any table structure, use PDF to Text.

Illustrative example: a 3-page bank statement into a spreadsheet

Illustrative scenario, not a recorded benchmark. File sizes, timings and results depend on the input and device. Try the reproducible samples.

A 3-page, 210 KB bank statement lists 94 transactions in a five-column table: date, description, reference, debit, credit. With the default gap threshold, the preview shows the debit and credit columns merged on some rows — the statement packs them tightly. Lowering the threshold from 12 pt to 8 pt separates them; the preview now shows five clean columns.

The downloaded CSV is 9 KB: 94 data rows plus 3 repeated header rows (one per page) and a handful of non-table lines like the page footer, which appear as single-cell rows. Two minutes in a spreadsheet removes those 6 stray rows, leaving a clean 94-row ledger — against roughly an hour of retyping.

Frequently asked questions

Which PDF tables convert to CSV cleanly?

Simple grids where every cell sits on one line and columns are separated by consistent white space — bank statements, price lists, exported reports. Merged cells, multi-line cells, and nested headers break the row-and-gap assumptions.

Why do two columns end up merged in my CSV?

The white-space gap between them is narrower than the column threshold, so the splitter treats them as one column. Lower the gap threshold and convert again; tightly packed tables often need a smaller value.

Can I convert a scanned PDF table to CSV?

Not directly — scans have no text items to cluster, so the result is empty. OCR gives approximate positions at best; for scanned tables, a dedicated route like the methods on our PDF to Excel page is more reliable.

How are commas inside table cells handled?

Cell text containing commas, quotes, or line breaks is wrapped in double quotes with inner quotes doubled, per the standard CSV convention. Spreadsheet applications read such files without misaligning columns.

What happens when the PDF has several tables or extra text?

Every text line on the page goes through the same row-and-column pass, so headings and paragraphs appear as rows with few columns, and consecutive tables run together. Delete the stray rows in your spreadsheet afterward.

Related tools