Word Tables to Excel
Operator: Abdulla Al Fahad. How tools are built and checked
Copying tables out of a Word report one at a time loses merged cells and turns the first column into a mess. This tool reads the .docx itself, finds every table, and writes them to an Excel workbook, one sheet per table or all stacked on one sheet, or to CSV files.
A general document converter flattens tables into text. This tool reads the table structure directly, so a heading that spans three columns stays one merged cell and each table can take its name from the caption or heading above it.
Key features
- One sheet per table, or all chosen tables stacked on one sheet with a title row between them
- Merged cells (column spans and vertical merges) kept as merged cells
- Sheet names from the caption or heading above each table
- Number detection that leaves codes, phone numbers and long IDs as text
- Pick which tables to include, with a preview and row and column counts
- CSV for one table, or a ZIP of CSVs for several
How Word tables, merged cells and captions become sheets
A .docx is a ZIP archive. The tool opens it in your browser, reads word/document.xml and walks the body for table elements. Each row and cell is rebuilt on a rectangular grid: a cell with a column span covers that many columns, and a cell that continues a vertical merge is joined to the cell that started it. Merged ranges are written to Excel as merged cells, so the layout survives.
Cell text is the cell's paragraphs joined with line breaks, with tabs and manual line breaks kept. Text inside hyperlinks, content controls and tracked insertions is included; text in tracked deletions is skipped. A table inside a cell is folded into that cell as lines whose cells are joined by ' | '. Headers, footers, text boxes and footnotes are not read.
Each table's name comes from the paragraph directly above it when that is a caption (Caption style, or text beginning 'Table 3'), otherwise from the last heading seen, otherwise it is 'Table N'. Sheet names are trimmed to Excel's 31 characters, stripped of the characters Excel forbids and made unique. Limits are 25 MB for the file, 300 tables, 600,000 cells and 32,000 characters per cell.
With 'detect numbers' on, cells such as 1,250.50, $40, (3.2) and 12% become real numbers with a matching number format (12% is stored as 0.12 shown as a percentage). Text that only looks numeric stays text: anything with a leading zero such as 00417, anything beginning with +, scientific-looking text, and numbers with more than 15 digits, which a spreadsheet would round. Text beginning with = + - or @ gets a leading apostrophe so it cannot run as a formula.
How it works
The XML is parsed with the browser's own parser and visited in document order, descending into content controls and tracked insertions. Each w:tbl becomes a grid: for every row the tool places each cell at the next free column, widens it by its span, and keeps vertical merges alive by remembering which cell is still open in each column.
The workbook is then written with ExcelJS. Merged blocks are merged in the sheet, the first row can be made bold and frozen, and column widths are set from the longest text.
Common use cases
- Turning a supplier's quote in Word into a sheet you can sum and sort
- Pulling all the tables of a 14-page annual report into one workbook, one sheet each
- Putting meeting-minute action tables from several documents into a single stacked sheet
- Exporting a Word form's tables to CSV for import into a database
- Recovering a price list that exists only inside a Word file
How to use this tool
- Drop the .docx; the tables are listed with their names, sizes and merges.
- Tick the tables to include.
- Choose one sheet per table or one stacked sheet.
- Decide whether to detect numbers and whether to bold and freeze the first row.
- Download the .xlsx, or the CSV or ZIP of CSVs.
Example
A Word report with a caption 'Table 2: Regional sales' above a table whose first row is one title cell spanning three columns
| Regional sales (spans 3 columns) |
| Item | Q2 | Q3 |
| 00417 | $40 | (3.2) |
| Europe | 1,250.50 | 12% |Sheet 'Table 2: Regional sales'
A1:C1 merged 'Regional sales'
A3 00417 kept as text (leading zero) | B3 40 formatted "$"#,##0 | C3 -3.2
A4 Europe | B4 1250.5 formatted #,##0.00 | C4 0.12 formatted 0%Tips for best results
- Give tables a caption in Word before converting; the sheet then has a readable name instead of Table 7.
- Use stacked mode to compare tables of the same layout; use one-sheet-per-table to keep wide tables readable.
- Switch number detection off for a table of codes and phone numbers; it is safer than relying on the leading-zero rule.
- If a merged title cell is in the way, turn on the header option: the first row is then bold and frozen on its sheet.
Edge cases to watch
Nested tables are flattened into text inside their cell, not made into their own table.
A table split across pages in Word is still one table; the page break is not a boundary.
Formatting such as colours and borders is not carried over, only text, merges and number types.
Pictures and drawings in cells are skipped.
Dates are not converted; they arrive as text exactly as written.
Common errors and how to fix them
- "This is not a Word .docx document"
- The file may be an old .doc, a renamed file, or damaged. Open it in Word and save it as .docx, then try again.
- More than 300 tables, or more than 600,000 cells
- Split the document, or save the part you need as its own file.
- The tables are in a text box or a header
- Only tables in the main body are read. Move the table into the body of the document.
- A number stays as text
- It has a leading zero, a plus sign, an exponent or more than 15 digits, which are kept as text on purpose. Switch off detection if you want all cells as text.
Best practices
- For a long report, include only the tables you need to keep the workbook small.
How merged cells are rebuilt
Word stores a horizontal merge as a number on the cell (it spans N grid columns) and a vertical merge as a marker on each row: 'restart' on the first cell and 'continue' on the ones below. The tool lays the grid out and writes the text only in the top-left cell of a merged block. The other cells in the block are marked as covered, and the merged range is registered with Excel, so selecting the block in Excel shows one cell.
Frequently asked questions
Does it work with .doc files?
No. Only the modern .docx format is read. Open an older .doc in Word and save it as .docx first.
Why is my order code still text?
Anything with a leading zero or a plus sign is kept as text, so codes like 00417 and numbers like +44 20 7946 0958 are not turned into numbers.