How to extract a table from a PDF

A PDF stores a table as a drawing instruction, not as a grid. The characters are placed at fixed coordinates and the borders are separate line objects, so nothing in the file says “this is row 3, column 2”. That is why a plain copy-paste turns a clean report into one long ragged column. To extract a table from a PDF you have to rebuild the grid by reading where every character sits and inferring the rows and columns from that geometry.

  1. Upload the PDF. Drop the file in the box above. Nothing is emailed and no account is required.
  2. Let the detector find the tables. Each page is scanned for aligned text runs and ruling lines, and every candidate table is listed separately.
  3. Check the preview. This is the step people skip and then regret. Confirm the header row landed in the header and that numeric columns are numbers, not text.
  4. Download as Excel or CSV. Take one table or all of them. Column types are preserved so totals still add up in the spreadsheet.

Why some PDFs extract cleanly and others do not

The single biggest factor is whether the file contains real text or a picture of text. Everything else is secondary.

Text-based PDFs

Exported from Excel, Word, an accounting package, or a reporting tool. The characters are stored as text with exact positions, so extraction is close to lossless. If you can select a word in a PDF viewer with your cursor, you have a text-based PDF and the extracted table should match the original almost cell for cell.

Scanned and image-only PDFs

A photograph or scan wrapped in a PDF container. There are no characters at all, only pixels, so the table has to be recognised with OCR before it can be reconstructed. Accuracy then depends on scan resolution, skew, and contrast. 300 DPI and straight pages give good results; a phone photo of a crumpled invoice does not. If selecting text in your viewer highlights a whole block as an image, this is what you have.

Excel, CSV, or Google Sheets — which export to pick

Excel (.xlsx) keeps data types, so dates stay dates and numbers stay numbers, and it can hold several tables as separate sheets. Pick it when the numbers will be used for calculation.

CSV is plain text and opens anywhere. It carries no formatting and no types, and every table needs its own file. Pick it when the destination is a script, a database import, or another tool.

Google Sheets is the right choice for collaboration. Export to CSV or Excel first, then import the file — and set the locale before you import, because a European decimal comma read under a US locale silently turns 1.234,56 into text.

Common problems when you extract tables from PDF files

The table spans several pages

Long tables repeat their header on every page. Extract each page, then stack the parts and delete the repeated header rows. Watch for a running total on the last page that is not part of the data.

Merged cells collapse

A cell merged across three columns has one text position but covers three grid slots, so it lands in one column and leaves two blank. The fix is to fill the value down or across after export — the geometry simply does not record that the merge existed.

Numbers arrive as text

Currency symbols, thousands separators, trailing spaces, and negative numbers written as (1,234) all keep a column from being numeric. Strip the symbols and convert parentheses to a minus sign, then re-apply the number format.

Columns are shifted or merged together

Tables laid out with whitespace instead of ruling lines are ambiguous: a wide gap may be a column break or just padding. Tables with visible borders extract far more reliably, which is worth knowing when you control how the PDF is produced.

The page is rotated

Wide financial tables are often printed in landscape inside a portrait page. Rotate the page to its reading orientation before extracting, or rows and columns come out transposed.

Doing it in code instead

For a one-off file, a browser tool is faster than writing a script. For a recurring job — a monthly statement, a nightly report — automation pays for itself. In Python, pdfplumber gives the most control over text-based PDFs, camelot works well when tables have ruled borders, and tabula-py wraps the long-standing Java implementation. Scanned documents need an OCR pass first. The Python tutorial walks through a working example.

Frequently asked questions

Can I extract a table from a PDF for free?

Yes. This tool runs a free daily allowance with no signup and no watermark on the output. The current remaining count is shown above the upload box.

Will the formatting survive?

Structure survives — rows, columns, headers, and cell values. Visual styling such as fonts, colours, and shading does not, because it is presentation rather than data. If a spreadsheet needs to look like the original report, restyle it after import.

Is my file kept?

Files are processed for extraction and are not published anywhere. For documents under a strict retention or confidentiality policy, use a local library instead so the file never leaves your machine.

What is the size limit?

20 MB per file and 10 pages per PDF on the free tier. For longer documents, split the PDF and extract the relevant page range.

Why does the same PDF work for someone else and not for me?

Almost always because one copy is text-based and the other is a scan. A file that has been printed and re-scanned loses its text layer entirely, even though it looks identical on screen.