You have a table in Word with carefully set column widths, centered text, and right-aligned numbers. When you copy that table into a Markdown editor, the alignment settings disappear, leaving everything left-aligned. The Markdown specification supports colon-based alignment markers in table headers, but Word does not export them automatically. This article shows you how to convert a Word table to Markdown while keeping left, center, and right alignment intact.
Key Takeaways: Convert Word Table Alignment to Markdown
- Manual Markdown alignment syntax with colons: Place colons in the separator row to set left
:---, center:---:, and right---:alignment for each column. - TableConvert.com online tool: Paste your Word table and choose Markdown output with alignment detection to automate the conversion.
- Pandoc command-line conversion: Use the
--to gfmor--to markdownoption with Pandoc to preserve table alignment from a saved .docx file.
How Word Table Alignment Relates to Markdown Syntax
Word stores table alignment as a property of each cell or column. The alignment can be left, center, right, or justified. Markdown uses a different system. In Markdown, you define alignment only in the separator row between the header and the body. The separator row consists of dashes and colons. A colon on the left side means left alignment. A colon on both sides means center alignment. A colon on the right side means right alignment. No colon means left alignment by default.
Word does not have a built-in export feature that translates its cell alignment into Markdown colon markers. When you copy a table from Word and paste it into a Markdown editor, the pasted content usually becomes a plain pipe-table without any alignment colons. The result is a table that looks left-aligned regardless of the original formatting.
Prerequisites for the Conversion
You need one of the following tools to complete the conversion with alignment preserved:
- A Markdown editor that supports pipe tables, such as Typora, Obsidian, or GitHub Flavored Markdown (GFM) viewer
- Access to a web browser for online conversion tools
- Pandoc installed on your computer if you prefer command-line conversion
Steps to Convert a Word Table to Markdown With Alignment
Method 1: Manual Alignment Conversion Using Pipe Tables
This method works when you have a small table and want full control over the alignment markers.
- Copy the table from Word
Select the entire table in Word by clicking the four-arrow icon at the top-left corner of the table. Press Ctrl+C to copy the table to the clipboard. - Paste the table into a plain text editor
Open Notepad or any plain text editor. Press Ctrl+V to paste. The table appears as tab-separated values. Each row is on a new line. Columns are separated by tab characters. - Replace tabs with pipes
Press Ctrl+H to open the Replace dialog. In the Find what field, press Tab. In the Replace with field, type a pipe character|. Click Replace All. Each row now looks like|cell1|cell2|cell3|. - Add a separator row after the header
Insert a new line right after the first row. On that line, type a pipe, then dashes and colons according to the alignment you want for each column. For left alignment, use:---. For center alignment, use:---:. For right alignment, use---:. Separate each column marker with a pipe. For example, a three-column table with left, center, and right alignment gets a separator row like|:---|---:|---:|. - Wrap the table in pipes
Ensure the first and last cells of every row have a pipe at the start and end. The header row should be|Header1|Header2|Header3|. The separator row should be|:---|---:|---:|. The body rows should follow the same pipe-wrapped format. - Test the Markdown table
Paste the full table into your Markdown editor. The text should render as a table with the alignment you specified.
Method 2: Convert Using TableConvert.com
TableConvert.com is a free online tool that reads table data from various sources and outputs Markdown with alignment markers.
- Copy the Word table
Select the table in Word and press Ctrl+C. - Open TableConvert.com
Go to tableconvert.com in your web browser. Click the Import tab and select HTML or CSV depending on your paste method. - Paste the table data
Click inside the import text area and press Ctrl+V. The tool parses the data and shows a preview grid. If alignment does not appear automatically, adjust the alignment by clicking the alignment icon above each column in the preview. - Set the output format to Markdown
In the Output format dropdown, select Markdown. The tool generates the pipe-table syntax including colon alignment markers. - Copy the Markdown code
Click the Copy to Clipboard button. Paste the result into your Markdown file.
Method 3: Convert Using Pandoc
Pandoc is a document converter that can read .docx files and output Markdown while preserving table alignment.
- Save the Word document
In Word, go to File > Save As and choose the .docx format. Save the file to a known folder. - Open a terminal or command prompt
On Windows, press Win+R, type cmd, and press Enter. On macOS, open Terminal. - Run the Pandoc conversion command
Type the following command and press Enter:pandoc input.docx -f docx -t gfm -o output.md. Replaceinput.docxwith your file path andoutput.mdwith the desired output file name. The-t gfmflag tells Pandoc to use GitHub Flavored Markdown, which supports pipe tables with alignment. - Open the output file
Openoutput.mdin a text editor. The table includes a separator row with colons that match the alignment from the original Word table.
Common Issues When Converting Word Tables to Markdown
Merged Cells Break the Pipe Table Layout
Markdown pipe tables do not support merged cells. If your Word table contains merged cells horizontally or vertically, the pipe table will have missing or extra pipes. Remove all merged cells in Word before converting. Use individual cells and repeat values as needed.
Column Widths Are Not Preserved
Markdown pipe tables do not control column width. The rendering engine decides the width based on the content. If you need fixed widths, add non-breaking spaces or HTML width attributes inside the table cells, but this is not standard Markdown. Consider using a different output format such as HTML if exact widths are required.
Alignment Appears Incorrect After Conversion
If the separator row does not contain colons, the table defaults to left alignment. Check that each column in the separator row has the correct colon placement. For center alignment, the pattern must be :---: with at least one dash between the colons. For right alignment, the pattern must be ---: with no colon on the left side.
Pandoc Does Not Detect Alignment
Pandoc version 2.10 or later supports alignment detection from .docx files. If you have an older version, update Pandoc by downloading the latest installer from pandoc.org. Run pandoc --version to check your installed version.
Manual Markdown Alignment vs Pandoc Conversion vs Online Tool
| Item | Manual Pipe Table | Pandoc Conversion | TableConvert.com |
|---|---|---|---|
| Setup required | None | Install Pandoc | Web browser |
| Alignment preservation | Manual colons | Automatic from .docx | Automatic from HTML paste |
| Handles merged cells | No | No | No |
| Batch conversion | No | Yes | No |
| Best for | Small tables with known alignment | Large documents with many tables | Quick one-time conversions |
You can now convert any Word table to Markdown with the correct alignment markers. For a single table, use TableConvert.com or the manual pipe table method. For multiple tables in a document, install Pandoc and run the command-line conversion. After conversion, always preview the Markdown table in your target editor to verify that the colons produce the expected alignment.