All posts
TutorialApril 15, 20264 min read

How to extract a table from a Word document

Native Word-to-Excel paste, python-docx for scripting, and what to do when the table is actually a screenshot inside the document.

By Dawid Sibinski

Most Word tables are real tables — Excel can paste them directly with row/column structure intact. The friction comes when tables span pages, have merged cells, or aren't actually tables at all but images of tables.

1. Word → Excel paste

Click anywhere in the table, then Layout (Table Tools) → Select → Table. Copy. Switch to Excel, paste. Each row goes to a row, each column to a column.

Quirks worth knowing:

  • Merged cells unmerge into the top-left cell with the rest blank — usually what you want.
  • Line breaks inside cells become alt-enter newlines in Excel; clean with Find & Replace if needed.
  • Number formatting from Word doesn't always survive; reformat in Excel after pasting.

2. python-docx for scripted extraction

MIT-licensed, walks every table in a document:

from docx import Document import csv doc = Document("contract.docx") for i, table in enumerate(doc.tables): with open(f"table_{i}.csv", "w", newline="") as f: w = csv.writer(f) for row in table.rows: w.writerow(cell.text for cell in row.cells)

For documents with hundreds of tables (regulatory filings, lease abstracts), this is hours faster than copy-paste.

3. The table is actually an image

Increasingly common: someone screenshotted a table from another tool and pasted the image into Word. python-docx and Excel paste both fail here.

Right-click the image → Save as Picture, then drop the image into ExtractFox's image data extractor. The extracted table comes back as a flat row-and-column structure ready for Excel.

Tables that span pages

Word handles these as a single logical table even though they break visually. Both the copy-paste route and python-docx see them as one table — no special handling needed. The case where this breaks is when the document author manually broke the table into separate tables on each page, in which case you'll need to stitch them back together after extraction.

More on tutorial

Stop reading, start extracting

Drop a PDF or image into ExtractFox and get structured data back in seconds.

Try a free extraction →