Guides › PDF Tables Explained

PDF Tables Explained: Why Data Extraction Is Harder Than It Looks

Technical Guide • 6 min read • Updated March 2025

The PDF Format Was Not Designed for Data Extraction

The PDF (Portable Document Format) was created by Adobe in the early 1990s with one goal: to display a document identically on any screen or printer, regardless of the software or operating system being used. It does this brilliantly. But this design goal creates a fundamental problem for data extraction.

Inside a PDF file, there is no concept of a "table," a "row," or a "column." Instead, there is a flat list of drawing instructions: "place this text at coordinates (x, y)," "draw a line from point A to point B," "fill this rectangle with color." A table is simply a visual illusion created by positioning text in a grid pattern and drawing borders around it.

When you want to extract a table from a PDF, software must reverse-engineer this visual representation back into structured data — figuring out which text belongs to which row, which values belong to which column, and where the table begins and ends. This is far more complex than it sounds.

The Two Fundamental Types of PDF Tables

Type 1: Tables with Visible Grid Lines

These are the easiest to extract. When a PDF contains actual line-drawing instructions that create borders between cells, extraction software can identify the grid structure by finding intersecting horizontal and vertical lines. Once the grid is established, it is straightforward to assign each piece of text to its corresponding cell.

Most PDFs generated from accounting software, financial reporting tools, and modern business applications produce this type of table.

Type 2: Tables Without Grid Lines (Whitespace-Only Tables)

These are significantly harder. Some PDFs format tabular data using only spacing — aligning text in columns purely through carefully placed whitespace, with no drawn borders. The reader's eye sees a table, but the software sees only a series of text fragments at various horizontal positions.

Extracting these tables requires sophisticated heuristics: clustering text fragments by proximity, identifying likely column boundaries based on consistent horizontal positions, and determining row separations based on vertical spacing. This approach works well in most cases but can struggle with irregular column widths or tables that span the full page width.

Type 3: Scanned PDFs (Image-Based)

In these PDFs, the entire page — including any tables — exists only as a raster image. There is no underlying text data at all. To extract tables, the image must first be processed by Optical Character Recognition (OCR) software, which attempts to identify characters and words from pixel patterns. The recognized text is then subjected to the same spatial analysis as Type 2 tables above.

OCR accuracy varies significantly depending on print quality, font clarity, image resolution, and language. Even with high-quality scans, OCR introduces character-level errors that can corrupt numerical data.

Why Some Conversions Come Out Perfect and Others Don't

Understanding what happens under the hood explains why results vary so widely between different PDFs — even when they look similar to the human eye.

Column Boundary Detection

When columns are not separated by lines, software uses statistical analysis of horizontal text positions to infer column boundaries. If two columns in your table happen to be very close together, or if one column contains unusually long text that overlaps with an adjacent column's horizontal range, the boundary between them may be misidentified.

Multi-Page Tables

A table that spans multiple pages presents a special challenge. The software must recognize that the content on page 2 is a continuation of the table that started on page 1, and not an entirely separate table. This is usually handled by checking whether the first row of a new page matches the column structure of the last table on the previous page.

Rotated or Diagonal Tables

Tables rotated 90 degrees (common in wide landscape-format reports) require the extraction software to handle rotated coordinate systems. Most tools handle 90-degree rotations well, but arbitrary rotations are typically not supported.

Nested Tables

Some complex PDFs contain tables within tables — for example, a main financial summary table where individual cells contain their own sub-tables. Correctly identifying and separately extracting nested tables is one of the most difficult challenges in PDF parsing, and most extraction tools do not handle them perfectly.

Headers and Footers

Page headers, footers, and watermarks that appear on every page can confuse table detection if they happen to overlap with table regions. Well-designed extraction software identifies these repeating elements and excludes them from table data.

How Our Tool Handles Table Detection

Our converter uses pdfplumber, a Python library built on top of the industry-standard pdfminer, specifically designed for structured data extraction. For each page of your PDF, it:

  1. Extracts all text objects along with their exact coordinates on the page
  2. Identifies all line-drawing operations that might represent table borders
  3. Applies a combination of line-based and whitespace-based table detection strategies
  4. Groups detected cells into rows and columns based on spatial relationships
  5. Exports each detected table as a separate sheet in the Excel workbook

The result is a multi-sheet Excel file where each sheet corresponds to one detected table. This structure makes it easy to navigate large documents and find the specific data you need.

How to Get the Best Results

  • Use digitally-created PDFs whenever possible. If you have the option to export directly from Excel, Word, or a reporting tool rather than printing and scanning, always choose direct export.
  • Prefer PDFs with table borders. If you are creating documents that others will need to extract data from, format tables with visible borders rather than relying on whitespace alignment.
  • Check the source application. PDFs exported directly from Excel or from financial reporting systems (SAP, Oracle, QuickBooks) typically produce excellent results. PDFs printed from older software or converted from other document formats may not.
  • Verify the result. Always spot-check the converted Excel data against your source PDF, especially for financial figures where precision matters.

Inside the Extraction Process: How PDF Tables Are Detected

Understanding how table detection works helps you predict when it will succeed and when it will struggle. At a technical level, modern PDF extraction libraries like pdfplumber work by analyzing the geometric structure of a PDF page.

Each element in a PDF — a line of text, a rectangle, a drawn line — has explicit coordinates. When a PDF is created digitally (not scanned), these coordinates are embedded in the file. An extraction library reads these coordinates and infers table structure from them.

Line-based detection

If the PDF table has visible borders drawn as PDF path elements (rectangles and lines), the extraction engine reads those paths to identify the grid. This is the most reliable scenario — the table grid is explicitly defined in the file structure, so the engine knows exactly where each cell is.

Whitespace-based detection

If a table has no visible borders but uses consistent spacing to align columns, the engine must infer column positions from the horizontal gaps between text. This works reasonably well for simple, well-aligned tables but is more prone to column merging or splitting errors, especially when some cells are empty or contain text of varying lengths.

Mixed structure

Many real-world PDFs have hybrid structures — some tables with borders, some without, some with merged header cells that span multiple columns. Handling these requires more sophisticated detection logic and sometimes manual intervention after conversion.

PDF Structure: What Makes a Good vs. Difficult PDF

There is no single indicator that predicts how well a PDF will convert, but here are the characteristics that correlate with easy, accurate conversion:

High-quality PDFs (convert reliably)

  • Exported directly from Excel, Google Sheets, or similar tools
  • Generated by ERP systems (SAP, Oracle, Sage) or financial reporting software
  • Tables with clear visible borders around each cell
  • Consistent column widths with no merged cells
  • No text that wraps across multiple lines within a single cell

Difficult PDFs (may need correction)

  • Scanned and saved as PDF images (require OCR before extraction)
  • Created by older software with non-standard PDF encoding
  • Tables with merged header cells or irregular column structures
  • Dense tables with many small cells and numerical data closely packed together
  • PDFs created from Word documents where tables use whitespace formatting rather than real table structures

When you know your PDF is in one of the difficult categories, plan for a few minutes of data cleaning in Excel after conversion. The time saved versus manual data entry is still substantial — even an imperfect extraction that requires some correction beats typing out every row by hand.

Try It on Your PDF

Upload a digital PDF and see your tables extracted as a structured Excel spreadsheet in seconds.

Start Converting for Free

More Guides