Skip to main content

How to extract a table from an image

Published

Reading the characters in an image is the easy half. The hard half is preserving which value belongs to which column — and that is what separates table extraction from ordinary OCR.

What goes wrong with plain OCR

Classic OCR scans in reading order and emits a stream of text. Run it over a five-column table and you get the header words, then the first row's values, then the second row's — with nothing marking where one column ends and the next begins.

You can sometimes rescue that with fixed-width splitting, but any column containing a value with a space in it breaks the assumption, and empty cells shift everything after them.

What table extraction has to do instead

  • Locate the table region and ignore titles, navigation, and footnotes around it.
  • Recognise the header row and use it to name the columns.
  • Infer column boundaries from alignment when there are no ruled lines.
  • Distinguish an empty cell from a missing one, so rows stay aligned.
  • Keep multi-line cell content together instead of splitting it into new rows.

Doing it with GridFiller

  1. 1. Crop to the table if the page is busy

    Not required, but it removes ambiguity when several tables or heavy page furniture share the image.

  2. 2. Upload the image or PDF

    PNG, JPG, WEBP, and PDF, up to 20MB per file.

  3. 3. Extract

    The vision model reads layout as well as characters, so the header row and columns survive.

  4. 4. Fix edge cases in the grid

    Merged cells, wrapped text, and repeated headers are the usual things to tidy.

  5. 5. Export CSV or XLSX

    Or keep the conversion in history and re-run it later with different settings.

Several images, one table

A long table captured in parts should be uploaded as one job with the append-rows strategy: the header is taken once and the remaining rows stack in upload order, so put the images in sequence.

Tables from different sources that describe the same thing are better handled by aligning on headers, which matches columns by name even when their order differs between sources.

A quick quality checklist

  • Does the row count match the source?
  • Did any value land one column to the left or right?
  • Are subtotal and section rows still mixed in with the data?
  • Do the decimals and currency formats look consistent?
  • Are the header names what the next system expects?

Try it on your own file

Upload a screenshot, image, or PDF and GridFiller returns an editable table you can export to CSV or XLSX.

Open GridFiller

Related reading