Markdown to Word
Paste Markdown or open a .md file and download a Word document with real heading styles, lists, tables, and code — editable in Word, Google Docs, and Pages.
265 words · 49 lines
Preview — Word applies the same fonts and styles
The file opens in Microsoft Word, Google Docs (upload to Drive → Open with Google Docs), Apple Pages, and LibreOffice. With a table of contents on, Word asks to update fields when it opens the file — say yes to fill in page numbers. Need the reverse? Convert Word to Markdown.
A Markdown to Word converter that writes real .docx
This online Markdown to Word converter reads your document with a GitHub-flavored Markdown parser and builds the Word file element by element, right in the browser. Every # heading becomes Word's Heading 1–6 style, lists get real numbering (so renumbering and indenting work the way Word users expect), tables become native Word tables, and images are embedded in the file. Nothing is sent to a server — the .docx is assembled on your device and downloaded directly.
That matters more than it sounds: a lot of "convert Markdown to Word" tools render HTML and save it with a .doc extension. Word opens those in compatibility mode, lists turn into typed bullets, and styles are gone. A proper Markdown to DOCX conversion gives you a document your colleagues can keep editing without noticing it started life as Markdown.
How to convert Markdown to a Word document
- Add your Markdown. Paste it, type it, open a .md file, or drag the file onto the editor. Drop image files at the same time and relative image paths like ./images/chart.png get embedded.
- Check the preview. It uses the font and size you pick, so it's a close stand-in for how Word will lay the text out.
- Set up the document. Choose a font (Calibri, Aptos, Arial, Times New Roman, Georgia…), base size, line spacing, A4 or US Letter, margins, page numbers, and an optional table of contents. Settings are remembered in this browser.
- Download the .docx. The file is named after your first heading. Open it in Word, Google Docs, Pages, or LibreOffice.
What each Markdown element becomes in Word
- # to ###### → Heading 1 to Heading 6 styles, bookmarked so [links](#heading) jump inside the document
- **bold**, *italic*, ~~strikethrough~~ → character formatting; `inline code` → the "Verbatim Char" monospace style
- [links](https://…) and bare URLs → clickable Word hyperlinks
- - and 1. lists → Word bullet and numbering definitions, nested up to nine levels, with custom start numbers kept
- - [ ] task lists → ☐ and ☒ checkboxes
- Tables → Word tables with borders, column alignment, a shaded header row that repeats on every page, and widths sized to the content
- ```fenced code``` → the "Source Code" paragraph style: monospace, shaded, syntax-colored
- > block quotes → the "Block Text" style with an indented side bar (nested quotes indent further)
- --- → a horizontal rule; images → embedded pictures scaled to the page width (SVG and WebP are converted to PNG so Word can show them)
- Inline HTML such as <sup>, <sub>, <mark>, <u>, <br>, and <img width> is honored too
The style names match the ones Pandoc uses, so a document made here and a document made with Pandoc look alike, and both convert back cleanly with a Word to Markdown converter.
Markdown to DOCX on the command line with Pandoc
If you convert Markdown to Word regularly — in a build, a script, or a folder full of notes — Pandoc is the standard command-line Markdown to DOCX converter. Install it with brew install pandoc, winget install pandoc, or your Linux package manager, then:
# the basic pandoc markdown to word command
pandoc input.md -o output.docx
# github-flavored markdown, with a table of contents
pandoc -f gfm input.md -o output.docx --toc
# use your own fonts, colors, and heading styles
pandoc -o reference.docx --print-default-data-file reference.docx
# …edit the styles in reference.docx in word, save, then:
pandoc input.md -o output.docx --reference-doc=reference.docx
# images referenced relative to another folder
pandoc input.md -o output.docx --resource-path=.:docs/images
# convert every .md file in a folder
for f in *.md; do pandoc "$f" -o "${f%.md}.docx"; doneThe reference-doc trick is the Pandoc way to get company templates: Pandoc copies the styles (not the content) from that file into every document it writes.
Python: Markdown to DOCX libraries
There's no single pure-Python Markdown to Word library as complete as Pandoc, so the common answers are:
- pypandoc — a thin wrapper around Pandoc and the most faithful option. pip install pypandoc_binary bundles Pandoc itself.
- python-docx + a Markdown parser— python-docx writes .docx files but doesn't understand Markdown. Parse with Python-Markdown or markdown-it-py, then either walk the tokens yourself (full control over styles) or feed the HTML to a helper like htmldocx.
# pip install pypandoc_binary
import pypandoc
pypandoc.convert_file(
"input.md", "docx",
outputfile="output.docx",
extra_args=["--toc", "--reference-doc=reference.docx"],
)
# pip install python-docx markdown htmldocx
import markdown
from docx import Document
from htmldocx import HtmlToDocx
html = markdown.markdown(open("input.md").read(), extensions=["tables", "fenced_code"])
doc = Document()
HtmlToDocx().add_html_to_document(html, doc)
doc.save("output.docx")Tips for a clean Markdown to Word conversion
- Start the file with a single # title — it names the download and becomes the document title in file properties.
- Don't skip heading levels (# then ###); Word's navigation pane and TOC nest by level, so skipped levels look odd.
- Leave a blank line before lists and tables — Markdown needs it, and without it they turn into plain paragraphs.
- For Google Docs, upload the .docx to Drive and open it with Google Docs; styles map to Google Docs' own heading styles.
- Need a fixed-layout file instead of an editable one? The Markdown to PDF converter prints the same Markdown to a PDF.
Frequently asked questions
How do I convert Markdown to Word?
Paste your Markdown into the box above (or open or drop a .md file), pick a font and page size if you like, and press Download .docx. The converter builds a real Word document in your browser — headings, lists, tables, code blocks, links, and images become native Word elements — and saves it straight to your downloads folder.
Is this Markdown to Word converter free, with no signup?
Yes. It's free, there's no account, no watermark, and no page or file limit beyond what your browser can hold. The conversion runs entirely on your device, so your document is never uploaded anywhere.
Is the output a real .docx or an HTML file renamed to .doc?
A real .docx (Office Open XML). Many online tools wrap HTML in a .doc file, which Word opens in a compatibility mode with broken lists and no styles. This tool writes proper Word paragraphs, Heading 1–6 styles, numbering definitions for lists, native tables, and embedded images, so the file behaves like one you made in Word.
Will my headings show up in Word's navigation pane and table of contents?
Yes. Markdown # headings are mapped to Word's built-in Heading 1 to Heading 6 styles, which is what the navigation pane, outline view, and table of contents read. You can also tick "Table of contents" to insert a clickable TOC at the top of the document.
How do I convert Markdown to DOCX on the command line?
Use Pandoc: pandoc input.md -o output.docx. Add -f gfm for GitHub-flavored Markdown, --toc for a table of contents, and --reference-doc=template.docx to apply your own Word styles. To convert a whole folder: for f in *.md; do pandoc "$f" -o "${f%.md}.docx"; done.
Is there a Python library to convert Markdown to DOCX?
The most reliable option is pypandoc, a Python wrapper around Pandoc: pypandoc.convert_file("input.md", "docx", outputfile="output.docx"). Install pypandoc_binary if you don't want to install Pandoc separately. python-docx can write Word files but doesn't read Markdown, so you'd pair it with a Markdown parser (Python-Markdown plus htmldocx, for example) and accept a simpler result.
Can I open the converted file in Google Docs, Pages, or LibreOffice?
Yes. For Google Docs, upload the .docx to Google Drive and choose Open with → Google Docs (or keep it as a Word file in Drive). Apple Pages and LibreOffice Writer open .docx directly. Headings, lists, tables, and images all carry over.
Why are some images missing from my Word document?
Images are embedded only when the browser can read their bytes. Inline data: images always work; images on other websites work when that server allows cross-site reads (CORS) — otherwise they're kept as a link and listed under notes. For images referenced by a relative path like ./img/chart.png, drop or open the image files together with the .md and they'll be embedded by file name.
Does it support tables, task lists, and code blocks?
Yes — it reads GitHub-flavored Markdown. Tables keep their column alignment and get a bold, repeating header row; task lists become ☐ and ☒ checkboxes; fenced code blocks use a monospace font on a shaded background, with syntax colors for common languages; block quotes get an indented side bar.
Related free tools
See all free tools →Built something? Put it online in seconds
host0 is the cloud for small software: bring any coding agent, build the tool only you need — like this one — and say "deploy to host0". Live at a shareable URL, no servers to run.