How to Convert Markdown to Word (on Windows and Mac, with Tables)
Paste the Markdown into a browser converter, download the .docx file it makes, and open that file in Word. That is the quickest way to convert Markdown to Word on Windows, Mac or Linux. Headings arrive as Word heading styles, lists as Word lists and tables as Word tables you can edit. For many files, or for a company template, Pandoc does the same job from the command line.
Convert an MD file to DOCX in your browser
Open MarkPrep's Markdown to Word page. The converter builds the .docx file in your browser, so your text is not uploaded. It is free and needs no account.
- Open your
.mdfile in any text editor, select all the text and copy it. The converter has no file-open button, so a saved file goes in by copy and paste. - Paste it into the Markdown box on the left. The live preview on the right redraws as you type, so you can fix the Markdown before you download anything.
- Click Download .docx. The file is saved as
document.docx. - Open it in Word and rename it.
To read a .md file without converting it, the Markdown viewer opens files directly.
What each piece of Markdown becomes in Word
Each Markdown element maps to a native Word feature. Here is what the converter writes, taken from its code:
| Markdown | In the .docx file |
|---|---|
# to ###### headings |
Word styles Heading 1 to Heading 6 |
**bold**, *italic*, ~~strikethrough~~ |
Bold, italic and struck-through text |
- item and 1. item |
Word bullet and numbered lists, with nested levels |
- [ ] and - [x] task items |
A list item starting with an empty or ticked box |
[text](https://…) links |
Clickable hyperlinks |
`inline code` |
Text in the Consolas font |
| Fenced code blocks | Consolas lines on a light grey background |
> quotes |
Indented italic paragraphs |
--- horizontal rule |
A thin line across the page |
 |
An italic note: [Image: alt text] |
| Pipe tables | Word tables with a bold header row |
Because the headings use Word's own styles, the navigation pane lists them and Word can build a table of contents from them. Images work differently. The converter can't download pictures from other websites into the file, so it writes each image's alt text as a note in its place. Insert the pictures in Word afterwards, using the notes to find where each one goes.
How tables convert from Markdown to Word
A GitHub-style pipe table becomes a Word table that spans the full page width. Its first row is bold and marked as a header row. When a long table runs onto a new page, Word repeats that row at the top.
Here is a small table in Markdown:
| Region | Q3 sales | Change |
| :--- | ---: | ---: |
| UK | 4,650 | +13% |
| Germany | 3,380 | +12% |
In Word it becomes a three-column table with "Region", "Q3 sales" and "Change" in bold across the top. The colons that set column alignment in Markdown are ignored, so every column starts left-aligned. Right-align the number columns in Word if you need to. Markdown tables can't merge cells, so if your table needs merged cells, merge them in Word.
A pipe character inside a cell has to be written as \| in the Markdown. Without the backslash, it starts a new column.
Markdown to Word on Mac, Windows and Linux with Pandoc
Pandoc runs on Windows, Mac and Linux. It is free and open source, under the GPL. Its install guide offers:
- Windows: a package installer from Pandoc's download page, or
winget install --source winget --exact --id JohnMacFarlane.Pandoc, orchoco install pandocwith Chocolatey. - Mac: a package installer, or
brew install pandocwith Homebrew. - Linux: packages in Debian, Ubuntu, Fedora, Arch and other repositories. Pandoc's guide warns that these can be older than the latest release.
Then run this in a terminal, in the folder that holds your file:
pandoc notes.md -o notes.docx
Pandoc picks the output format from the .docx extension. To convert every Markdown file in a folder, loop over them. On a Mac or Linux, in a bash or zsh terminal:
for f in *.md; do pandoc "$f" -o "${f%.md}.docx"; done
On Windows, in PowerShell:
Get-ChildItem *.md | ForEach-Object { pandoc $_.Name -o ($_.BaseName + ".docx") }
To match a house style, add --reference-doc=template.docx. Pandoc then uses that file's styles, margins, page size, header and footer. Its manual explains how to make a starting template. Run pandoc -o custom-reference.docx --print-default-data-file reference.docx, then change the styles in Word.
What to fix in the Markdown before you convert
A few things in a Markdown file don't come out well in the converter. Check for these before you paste:
- YAML front matter. The block between
---lines at the top of many notes turns into a stray line and a heading. Delete it before you paste. - Footnotes. Markers such as
[^1]stay as plain text and don't become Word footnotes. Turn them into brackets, or convert the file with Pandoc, whose Markdown supports footnotes. - Raw HTML. Tags such as
<b>appear as text in the document. - Images. Each one becomes an alt-text note, as above, so write useful alt text in the Markdown.
- Right-to-left text. The converter sets no right-to-left paragraph direction. For Arabic or Hebrew, change the direction in Word after you open the file.
Common questions
Is there a free Markdown to Word converter online?
Yes. The converter is a web page, but your browser builds the .docx, so the text stays on your computer. It adds no watermark and asks for no sign-up. Pandoc is free too, as a program you install.
Can I convert Markdown to DOCX with my own template?
Yes, with Pandoc. Its --reference-doc option applies your template's styles. The converter uses standard built-in styles. Change Heading 1, Normal and the other styles in Word after you open the file, and every heading updates at once.
Can I export Markdown to Word automatically?
Yes, with Pandoc. Put the loop above in a script, and it converts every .md file in the folder each time it runs.
Does the converter make .doc files?
No. It writes .docx only, the Office Open XML format. Word, and other programs such as LibreOffice, open .docx files.
Which Markdown to Word converter is best for you?
For one document, the converter is quicker. You paste, check the preview and download, and you can edit the Markdown until the preview looks right. For a folder of files, a Word template or a script, Pandoc is the better fit, because one command converts each file the same way.
Paste your text into the converter to make your first Word file. For the reverse trip, Word to Markdown turns a .docx back into Markdown. Markdown to PDF prints the same text as a PDF.
Try it on your own file
Convert a document and watch the token counter. It's free, needs no account and uploads nothing.