Convert Word Tables to Markdown Tables
Learn how to copy an MS Word table to Markdown, clean up the text, add the separator row, and check the result before you publish it.
If you have a table in a Word document and need the same table in Markdown for a README, a wiki page or a static site, you may wonder how to copy an MS Word table to Markdown without losing rows or columns. Paste a Word table into a Markdown editor and you usually get a jumble of spaces and leftover formatting instead of a working table. Word stores a table as formatted cells, while Markdown tables are plain text built from pipe characters and dashes.
This guide covers one direction only: taking a table that already exists in Word and writing it as a Markdown table. It does not cover turning a Markdown table into a Word table. You will get a method you can carry out in any plain text editor, along with checks that confirm the rows and columns came through intact.
The method works for simple grids and for tables with many rows. Tables with merged cells or multi-line cells need a few extra decisions, which are covered below.
How do you copy an MS Word table to Markdown? The short answer
Copy the table as plain text, replace the tab separators with pipes, add a dashed line under the header row, and confirm that every row has the same number of cells.
| Your situation | What to do | Why |
|---|---|---|
| Simple table with one header row | Copy as plain text, convert tabs to pipes, add the separator row | This produces a valid Markdown table with little cleanup |
| Table has merged cells | Repeat the value in each cell or leave the extra cells empty, and note the merge in text | Standard Markdown tables have no merge syntax |
| Cell text contains a pipe character | Escape each literal pipe with a backslash placed in front of it | An unescaped pipe is read as a column break |
| Table sits inside a scanned PDF | Run OCR first, export to Word, then follow the steps | You need selectable text before you can copy it |
| Cells hold several lines of text | Shorten the text or move the detail below the table | Table cells in most Markdown renderers must fit on one line |
Before you start
Check these points first. Each one prevents a common rework step later.
- Confirm the table is real text, not a picture. Copying a picture of a table gives you nothing to convert. Click into a cell and select a word. If only that word highlights, the table is text.
- Count the columns and note any merged cells. Every Markdown row must have the same number of cells, so you need the column count before you start.
- Work on a copy of the Word file. You will be editing the text as you go, and the original should stay untouched.
- Decide where the Markdown will be read. Platforms differ in how they render tables, so test the final file on the platform your readers will use.
- Start from a PDF only if you have to. If the table is in a PDF, the PDF editor in the OmniDoc desktop client can run OCR on scanned pages and export the content to Word. If you prefer to fix the Word file in a Word-compatible editor first, the UniDoc web editor supports Word-compatible editing.
Copying an MS Word table to Markdown, step by step
- Open the Word file and select the entire table. Drag across every cell or use the table selection handle, so the last row and column are included.
- Copy the selection and paste it into a plain text editor. Use plain-text paste so formatting does not come along. You should see one row per line, with cells separated by tab characters. If you see Word markup, paste again as plain text.
- Replace each tab with a space, a pipe and a space. Use your editor's find-and-replace. Then add a pipe at the start and end of every line, so each row becomes a complete Markdown row.
- Add the separator row under the header. Insert one line of dashes, with one group per column. For a three-column table, the line looks like
| --- | --- | --- |. This line tells the parser that the first row is a header. - Escape literal pipes inside cells. Put a backslash in front of every pipe that belongs to the cell text. Without it, the pipe splits the cell into two columns.
- Fix merged and multi-line cells. Repeat a merged value in each cell it covers, or leave the extra cells empty and explain the merge in a sentence below the table. Keep each cell to one line.
- Check the cell count on every line. Each row should contain the same number of pipes as the header. A short row is a common cause of a table that fails to render.
- Save the file as Markdown or paste the block into your Markdown document. Then open it in the viewer your readers will use and confirm the table displays as a grid.
Check the result
Compare the Markdown output against the original Word table before you publish.
| Check | How to see it | If it's wrong |
|---|---|---|
| Row count | Count the data rows in Word and in the Markdown | Missing rows usually mean the selection stopped short. Select the table again and recopy it |
| Column count | Count the pipes in the header and in a data row | Add or remove cells so every row matches the header |
| Separator row | Look for a line of dashes and pipes directly under the header | Add the line. Without it, the table will not render |
| Rendering | Open the file in the Markdown viewer your readers use | If pipes appear as plain text, recheck the separator row and any escaped characters |
| Cell text | Compare numbers, names and dates against the Word table | Correct each cell by hand, because pasting can drop characters or spacing |
❓ FAQ
1. Can I paste a Word table straight into a Markdown file?
Usually not cleanly. Pasting into a rich-text editor can keep formatting, and pasting into a plain text editor gives you tabs rather than pipes. You still need the steps above to build a valid table.
2. What if my table is in a PDF?
If the PDF is scanned, run OCR first using the PDF editor in the OmniDoc desktop client. Then export the content to Word and follow the steps in this guide. Make sure the text is selectable before you copy it.
3. How do I show a merged cell in Markdown?
Standard Markdown table syntax has no merge feature. Repeat the value in each cell it covers, or leave the extra cells empty and add a short note below the table that explains the merge.
4. Does bold text survive the conversion?
You can mark bold text inside a cell with double asterisks. Color, font size and cell shading have no Markdown equivalent, so you will need to remove them or describe them in text.
5. Can I translate the table while I convert it?
OmniDoc can translate Word and Markdown files, and it keeps tables in the output. You can translate the file first and then convert the table. Check the translated cells yourself, because machine translation can change meaning, especially in numbers, names and technical terms.
📝 Summary
Converting a Word table to Markdown comes down to clean plain text, pipe separators, one dashed header line and matching cell counts. Handle merged cells before you start, and compare the rows, columns and numbers against the original. Use these steps whenever you need to copy an MS Word table to Markdown for a README, wiki or static page.


