DocoPDF
Guide

How to Extract Data from a PDF

By DocoPDF Team · 2026-12-02 · 1254 words

Extracting data from a PDF means pulling its tables or text out into a format you can actually work with — one clean CSV per table, a real Excel workbook, or plain text. Scanned pages need OCR first, and the whole job can run on your device so the file never leaves your browser.

What extracting data from a PDF means

A PDF does not store a table as a table. It stores text as positioned glyphs — characters placed at coordinates on the page — with rules drawn between them. Extraction rebuilds that structure: glyphs cluster into cells, cells into rows, rows into tables.

That is why results vary. A born-digital PDF — exported from Word or generated by an invoicing system — carries exact text positions, so the grid can be rebuilt faithfully. A scanned PDF is a picture of a page — until OCR runs, there is no text to extract.

Two routes cover nearly every job. For tables, go to CSV with Extract Tables or straight to a workbook with PDF to Excel. For text, export the document with PDF to Text or copy just the parts you need with Copy from PDF.

How to extract tables from a PDF

Option A: one clean CSV per table

  1. Open Extract Tables and drop your PDF in.
  2. Pick the pages — all of them, or just the annexure, such as "4-7" — without re-reading the whole document.
  3. Choose a delimiter: comma, semicolon or tab. Comma suits most spreadsheets; semicolon matters where Excel in your region expects it.
  4. Choose the output — a ZIP with one CSV per table, or one combined CSV — and run it.

The engine segments each page into tabular runs, so a paragraph sitting between two tables never leaks into either. Cells snap to column anchors, keeping jagged rows in shape, and the output is RFC-4180 CSV, ready for Excel, Google Sheets or LibreOffice. Empty cells stay empty: the true column structure is kept, so values never shift left to fill a gap.

Option B: a real Excel workbook

  1. Open PDF to Excel.
  2. Check the live preview of the page-1 grid before converting.
  3. Choose one sheet per page, or the whole document stacked into a single sheet, then download the .xlsx.

Pages that draw real border lines — most invoices, bank statements and price lists — are read cell for cell from those rules; borderless pages fall back to clustering text by position. The workbook is real Office Open XML: a bold header row, and numbers like 42 or 80.5 land as numeric cells ready for formulas. Limits are published: up to 20 sheets, 500 rows and 60 columns per sheet, with English and Hindi supported and Devanagari text intact.

How to extract text from a PDF

  1. Open PDF to Text.
  2. Pick a layout. Flow rebuilds paragraphs and merges hyphenated line breaks back into whole words; Lines keeps every visual break — better for forms and code.
  3. Choose pages, such as "all" or "1-3, 7", and switch on page markers if you need to cite page numbers.
  4. Export the plain UTF-8 .txt file.

For smaller jobs — quoting a clause into an email, lifting one paragraph — Copy from PDF is quicker. Click the blocks you want on the page preview, then copy them as clean text, Markdown or CSV. Selected blocks copy in reading order, even across pages.

Limits to know before you start

  • Borderless tables are harder. Ruled tables are read from their actual lines. Borderless ones are rebuilt from text positions — fine on aligned columns, but tangled layouts can need a tidy-up.
  • Styling does not survive. Extraction carries text and numbers only: fills, colours, borders, merged-cell styling and any formulas behind the printed values are not recovered. Re-apply formatting in your spreadsheet.
  • Wrapped text can wander. A continuation line under a row usually merges into that cell, but rows where every column wraps at once may land as their own row.
  • Scans need OCR, and quality matters. A scanned page holds no text, so extraction returns nothing until you run PDF OCR. Pick 300 DPI over 150 for small or Hindi text, and turn on deskew to straighten tilted scans — up to ±10 degrees — before recognition. The English and Hindi models download once, then work offline. Handwriting is not supported.

Common mistakes

  1. Copy-pasting a table straight from a PDF viewer. The viewer hands you positioned text with breaks where the page wrapped, so columns collapse into porridge. Use the table extraction path instead.
  2. Expecting perfect cells from a photo of a table. A phone photo is an image, and OCR follows the scan: straight, sharp pages read well; crooked, dim ones do not.
  3. Extracting from a scanned PDF without OCR. The result comes back empty — there is no selectable text to cluster. OCR the file first, then extract from the OCRed copy.

When not to extract data at all

  • The PDF is an interactive form. Fillable fields are read directly by the form tools; rebuilding them from page text is the hard way around.
  • You need a few lines, not a dataset. Copy from PDF exists for exactly this — select, copy, paste, done.
  • You are feeding an AI. Prepare PDF for AI exports LlamaIndex-ready JSON — one text document per page, each carrying clean metadata such as file, page id, title and author — so a RAG pipeline gets structured input instead of a raw dump. It runs on your device; the document never leaves it.

Frequently asked questions

Can I get tables into Excel?

Yes, two ways. PDF to Excel builds a real .xlsx workbook with numeric cells, and Extract Tables writes CSV that any spreadsheet opens.

What about scanned documents?

Scanned pages are images, so direct extraction returns nothing. Run PDF OCR first — English and Hindi, on your device — which adds an invisible text layer under the scan, then extract from that copy. A straight page scanned at 300 DPI reads best.

Does copy-paste keep table structure?

Usually not. A PDF viewer copies positioned text, not a grid, so columns flatten into lines. Copy from PDF does better with its CSV mode: wide gaps inside a line become columns and each visual line becomes a row.

Why is one column empty in some rows?

Because that cell is empty in the PDF too, or holds a value placed slightly off the column grid. The CSV keeps the true column structure, so empty cells stay empty instead of shifting data left.

CSV or Excel — which should I pick?

Pick CSV when you want just the data — one file per table, ready for scripts or any text tool. Pick Excel when you want a workbook with numeric cells you can write formulas against.

Is my file uploaded anywhere?

No. These tools run entirely in your browser — the PDF is never uploaded. The OCR language models are the only download — once, from this site — and afterwards they work offline.

Extract your tables now

A PDF full of numbers is not a life sentence of retyping. Open Extract Tables, drop in the file, choose your pages and delimiter, and download one clean CSV per table — entirely on your device, the document never leaving your browser.