How to use the docx tables to csv extractor
- Choose a Word file (DOCX), up to 25 MB.
- Tick Repeat the value in merged cells if you want merged cells filled in. By default they keep one value and leave the rest empty.
- Read the list of tables with their rows, columns and merged positions, and pick a table to preview its first 30 rows.
- Download the table you are looking at as a CSV file, or all the tables in one ZIP file.
Formula
A DOCX file is a ZIP archive, and the text of the document is in word/document.xml
Each table is a w:tbl element holding rows (w:tr) and cells (w:tc)
A horizontal merge is a gridSpan on a cell. A vertical merge is a vMerge, with the first cell marked restart and the cells below it continuing.
Quotes, commas and line breaks inside a cell are escaped so that the CSV opens correctly
A table inside a cell is listed as its own table, and the outer cell shows its number, such as [table 2], where it was.
A Word file with two tables
A document has a plain table of 3 rows and 3 columns, with cells A11 to A33, and a second table of 4 rows and 4 columns with two merges. In the second table, the header cell "Merged header" spans columns 2 and 3, and "Tall cell" spans rows 2 and 3 of the first column.
The tool finds 2 tables. The first becomes 3 lines of 3 values. The second has 2 merged positions, and it becomes B11, "Merged header", an empty cell and B14 in the first row, then "Tall cell" in the second row and an empty cell in the same column of the third row. With repeating on, "Merged header" and "Tall cell" are written in each position they cover.
Merged cells in the output
A CSV has no merged cells, so a merge has to be unfolded. The default leaves a covered position empty, which preserves the grid and does not repeat the text, and that is best when you will sum or count the data. Repeating the value fills each covered position with the merged text, which suits data you will sort or filter.
To turn CSV files into Excel workbooks, use the CSV to Excel converter. To take the text of the whole document, see the DOCX text extractor.
What is and is not read
The tool reads tables from the main text of the document. It does not read tables in headers, footers, text boxes or in comments, and it ignores pictures and formatting such as bold and colors. Fields and formulas show the text Word last saved. A file saved in the older DOC format, or one protected by a password, is not accepted, and the page tells you so.
To pull out tables from a web page instead, see the HTML table to CSV converter. To list comments and tracked changes, use the DOCX comments and tracked changes extractor.
Assumptions and limits
- The file is a DOCX document. Older DOC files and files with a password are not read.
- Only tables in the main body of the document are extracted.
- Cell text is the text saved in the file. Several paragraphs in a cell are joined with line breaks.
- Everything is processed in your browser and nothing is uploaded.
Frequently asked questions
How do I get a table out of a Word document?
Choose the DOCX file. The page lists each table, and you can download it as a CSV file that opens in a spreadsheet.
What happens to merged cells?
A merged cell keeps its text in the first position it covers, and the other positions are empty unless you choose to repeat the value.
Can I get all the tables at once?
Yes. Download all tables as a ZIP file with one CSV for each.
Does it work on nested tables?
Yes. A table inside a cell is listed as a separate table, and the cell it came from shows its number.