Skip to main content

October 20, 2026

How to Extract Tables from Images to Excel and Text

Learn how to extract tables from images, invoices, and documents into Excel or CSV: grid detection, reading order, and AI vs classical OCR workflows.

By Elango P · About this site

Illustration for article: How to Extract Tables from Images to Excel and Text

Extracting data from tables trapped inside images, photographed invoices, balance sheets, and PDF reports is one of the most frequent requests in document processing. Retyping hundreds of numerical cells manually is slow and invites transcription errors.

However, standard optical character recognition was designed for continuous flowing text, not two-dimensional grid structures. At ImgToText, our tools—including Image to Text and Receipt to Text—extract clean text from images with AI vision support. This guide explains why tables are technically difficult for OCR, how grid lines and white space affect extraction, and provides a dependable step-by-step workflow to convert table images into editable Microsoft Excel or Google Sheets spreadsheets.

OCR blog invoice example
OCR blog invoice example

Table of Contents

---

The 2D Grid Challenge: Why Tables Break Standard OCR

When you read a paragraph of prose, words follow a single, linear trajectory: left to right, line by line.

A table, by contrast, is a two-dimensional topological matrix. Every cell belongs simultaneously to a row and a column. The visual hierarchy relies on spatial coordinates rather than reading flow.

Standard OCR engines encounter major failure modes when processing tables without layout awareness:

  1. Cell Text Wrapping: If Column A has a cell with three lines of wrapped description (e.g., "15-inch Laptop Sleeve\nWaterproof Polyester\nNavy Blue") while Column B only contains single-line price ("$24.99"), a naive OCR engine scanning purely top-to-bottom will slice through the line mid-way, interleaving the price between the description words.
  2. Missing Grid Alignment: When white-space separates columns instead of solid borders, engines struggle to determine whether a gap signifies a column break or simply wider word tracking.
  3. Merged Cells and Sub-Headers: Spanning headers (e.g., "Q1 2026" spanning January, February, and March) break simple vertical column slicing algorithms.

---

Bordered vs Borderless Tables

Understanding your table type helps you anticipate how clean the OCR extract will be:

Table TypeVisual AppearanceClassical OCR BehaviorAI Vision OCR Behavior
Bordered (Grid)Solid lines separate every row and columnExcellent line detection; but horizontal lines can bleed into charactersStrong; distinguishes cell borders from minus/dash characters
Semi-BorderedHorizontal dividers present; no vertical column linesReads rows accurately; column separation requires delimiter parsingHigh accuracy; identifies vertical column gutters
BorderlessPure whitespace alignment (common in receipts & invoices)Prone to collapsing adjacent columns into a single stringExcellent; recognizes semantic spatial clusters

For bordered tables, classical preprocessing algorithms use morphological kernels (horizontal and vertical dilation) to isolate and mask the grid lines. For borderless tables, multimodal AI models provide superior results because they rely on semantic clustering rather than pixel geometry alone.

---

How Modern AI OCR Interprets Table Layouts

Traditional OCR approaches tables through pure bounding-box heuristics: detecting character bounding rectangles, grouping them into words, clustering words into lines, and attempting to find vertical gutters.

Modern vision-language models—such as Google Gemini 2.5 Flash used on ImgToText—approach tables holistically:

Table Image (JPEG / PNG / Screenshot)
                 │
                 ▼
     Visual Spatial Understanding
  - Identifies column headers
  - Understands column alignment (left-aligned text, right-aligned currency)
  - Detects row boundaries regardless of cell height variation
                 │
                 ▼
     Structured Text Output
  - Preserves line breaks between rows
  - Employs consistent tab/spacing delimiters between columns

This prevents the classic failure mode where table columns become scrambled into a disjointed jumble of words.

---

Step-by-Step: From Table Image to Excel or Google Sheets

Follow this practical workflow to turn any table image into a clean spreadsheet:

Step 1: Crop Tightly to the Table Bounds

Do not upload the entire page if you only need the table. Remove page headers, surrounding explanatory paragraphs, and page numbers. Eliminating extraneous text ensures the OCR engine dedicates its full spatial attention to the grid.

Step 2: Correct Image Skew

If the image was captured with a smartphone at an angle, the horizontal row lines will tilt diagonally. Skew causes characters from Row 1 to drift down into Row 2. Straighten or deskew the image prior to conversion (or use a flatbed scan).

Step 3: Run OCR on ImgToText

  1. Navigate to ImgToText Image to Text or Receipt to Text.
  2. Upload your cropped table image.
  3. Keep the default AI OCR mode enabled (or toggle Clean Mode if running on browser-only fallback).
  4. Click Extract Text.

Step 4: Copy Structured Text

In the results panel, review the extracted text. You will observe that each row is placed on a new line, with items separated by tabs or spaces. Click the Copy button.

Step 5: Import into Microsoft Excel or Google Sheets

Instead of pasting blindly, use spreadsheet delimiter controls for instant column splitting:

#### In Microsoft Excel:

  1. Paste the text into cell A1.
  2. Select Column A, navigate to the Data tab on the ribbon, and click Text to Columns.
  3. Choose Delimited, click Next.
  4. Check Tab and/or Space (or check Treat consecutive delimiters as one).
  5. Click Finish. Your data will instantly snap into distinct columns.

#### In Google Sheets:

  1. Paste the text into cell A1.
  2. Click the small clipboard icon that appears at the bottom-right of the pasted range.
  3. Select Split text to columns.
  4. Choose Detect automatically or set the separator to Space / Tab.

---

Handling Financial Tables: Avoiding Number & Decimal Errors

In balance sheets, tax schedules, and invoice tables, a single misread character can distort totals. Always apply these verification checks:

  1. Zero ('0') vs Letter 'O': High-contrast fonts with narrow letterforms often cause OCR engines to mistake 'O' for '0'.
  2. One ('1') vs Pipe ('|') vs Lowercase 'l': If vertical table borders intersect with numbers, an invoice amount like | 120.00 can be misread as 1 120.00.
  3. Decimal Point ('.') vs Comma (','): Dust, paper texture, or faint toner can turn decimal points into commas or eliminate them entirely.
  4. Formula Reconciliation: In Excel, write a quick formula =SUM(B2:B20) at the foot of your numerical column and cross-check it against the printed grand total on your source image. If the numbers match, you have mathematically verified the OCR accuracy.

---

Practical Workarounds for Complex Multi-Page Tables

When dealing with large multi-page reports or catalogs:

  • Extract Page by Page: Use our PDF to Text Converter to render pages individually rather than feeding 50 pages at once. This avoids layout drift.
  • Maintain Separate Column Headers: If multi-page tables repeat headers at the top of each page, extract each section, verify the headers line up, and append the rows beneath each other in Excel.
  • Download Word DOCX First: If you need to preserve paragraph formatting within large table cells, download the DOCX export from ImgToText, open it in Word, and use Word's Convert Text to Table feature before transferring to Excel.

---

Try free image to text OCR

Upload an image to extract editable text — AI OCR runs first (images go to Google Gemini via our server); browser OCR is the fallback. No signup required.

Extract text from images