How to Convert an Image of a Table to CSV

By Arin Prajapati · Published

The short answer

Open Table OCR, add one clear image of an English table, leave Row grouping tolerance at 12 px initially, and press Read the table. Download the CSV and compare every row and column with the image. Blank cells, merged headings and OCR errors require manual correction.

Start with the best available table source

If you can export the original spreadsheet as CSV, do that: OCR is unnecessary and can introduce errors. For a PDF containing selectable text, try Extract tables from PDF. Use Table OCR when the table exists only as pixels in a screenshot, scan or photo.

Capture one table at a time. A direct screenshot is usually easier to read than a phone photograph. For photos, keep the camera square to the page, avoid shadows and glare, and crop away surrounding paragraphs. Keep all headings and values you need, but remove unrelated text that could become extra rows.

The current tool initializes an English recognition model. The underlying Tesseract.js project supports other language configurations, but that does not mean this tool exposes them: there is no language selector here.

Convert the image and review the CSV

  1. Open Table OCR and add one image. A clear PNG or JPEG is a useful starting point; other image files still need to be decoded successfully.
  2. Leave Row grouping tolerance at its default 12 px for the first run. The slider ranges from 4 to 40 px.
  3. Press Read the table. The tool applies greyscale and contrast preprocessing, recognizes words, then groups them into rows and cells.
  4. Review Rows read and Confidence, then download the CSV. Its base filename matches the source image.
  5. Import it into your spreadsheet as comma-delimited text. Compare the column count and each value with the original image before calculating totals or sharing it.
  6. Save a corrected spreadsheet copy if you need formatting or an .xlsx file. The tool itself outputs CSV, not an Excel workbook.

When importing identifiers such as 00127, choose text for that column so the spreadsheet does not drop leading zeros. Similarly, check dates and decimal values after import; correct recognition does not prevent the spreadsheet from interpreting text differently.

Try the public synthetic example

Download the synthetic table image, set Row grouping tolerance to 20 px, and run it. The existing saved CSV output contains:

Item,Cost
Coffee,4.20
Bagel,3.10

Those are the actual saved output values, not a guarantee that every run or image will produce perfect text. Open the source image beside the CSV and proofread it. OCR output may be imperfect even when a small example looks tidy; the example setting of 20 px also differs from the tool’s 12 px default.

How rows and columns are inferred

The engine uses recognized word positions rather than detecting a spreadsheet grid. It sorts words from top to bottom and groups them by their top-edge height. When a word is farther than the tolerance from the current group’s starting height, it starts another row.

Within each row, words are sorted left to right. A horizontal gap greater than 0.9 times the next word’s height starts a new cell; smaller gaps join words with a space. There is no column-gap control, and the engine does not establish a fixed set of column positions shared by all rows.

This explains the most consequential limitation: an empty cell contains no word, so it does not produce a blank placeholder. A later value can move left in the CSV. Ruled borders do not prevent this because the tool does not use them to reconstruct cells. Merged headings and text wrapping over two lines can also produce inconsistent row lengths.

Quotes and commas inside recognized cell text are escaped for CSV. That protects the file’s syntax; it does not establish that the cell was recognized correctly or assigned to the right column. CSV does not retain borders, shading or merged-cell formatting.

Adjust the input or tolerance for the problem you see

SymptomWhat to try
One visual row becomes two CSV rowsRaise tolerance a little; straighten a tilted photo before retrying.
Adjacent visual rows mergeLower tolerance and compare the new row count with the image.
Two columns become one cellUse a source with clearer separation between columns; changing row tolerance does not change the horizontal gap rule.
Values shift left after a blank cellInsert the missing blank manually and check the rest of that row.
A merged heading disrupts the outputCrop and recognize the body separately, then add a clean header in the spreadsheet.
Digits or punctuation are wrongUse a clearer original and correct against the image; check 0/O, 1/I, minus signs and decimal points.
No text is readCheck image orientation, text size, contrast and decoding; try a tightly cropped PNG or JPEG.

Upscaling alone does not create missing detail. If you can retake the photograph or capture a higher-resolution original, do that before repeatedly increasing tolerance. Larger tolerance can join different rows and cannot repair character recognition.

Proofread structure as well as spelling

Check that every source row appears once, every value sits under the correct heading, and intentional blanks are still blank. Recalculate a few totals independently and inspect any unusually large or negative amounts. A high confidence score summarizes recognition; it does not verify column alignment, arithmetic or completeness.

For text without table structure, use Screenshot to text. For complex tables with many merged or empty cells, manual reconstruction in a spreadsheet may be quicker than repairing repeated OCR layout errors.

Engine downloads are separate from image uploads

Recognition runs in the browser using a worker, WebAssembly core and English model served from /engines/ocr/. The engine reports roughly 7 MB of startup assets. These are downloads to your browser; the selected image is passed to local recognition rather than uploaded for server-side OCR.

A failed worker or model download can prevent startup even though recognition itself is local. Retry with a connection and allow those assets to load. Do not treat a successful previous run as an unconditional offline guarantee; asset availability depends on browser storage and caching. For a practical check, see how to tell whether a website uploads your file.

Tools mentioned in this guide

Analytics preferences

Help us understand which tools and file types people use. File contents always stay on your device.

Filename sharing is optional and off by default. Names can contain personal information. Changes apply to future events; disabling sharing does not delete earlier records.

Read our privacy policy