Markdown to Word Converter: 5 Free Ways to Export .md to .docx
Markdown to Word Converter: 5 Free Ways to Export .md to .docx
Markdown is the format you write in: plain text, easy to diff, readable in any editor. It's the format almost nobody else wants to receive. The moment a client, an editor, or a compliance reviewer needs to open your file, track changes, or add comments, you need an actual Word document.
This is the opposite of what file2markdown does: it converts Word documents (.docx), PDFs, Excel spreadsheets and other files into Markdown for AI pipelines and RAG workflows, and it does not convert Markdown to Word. But the question comes up from the same audience: you've got AI-generated Markdown, a README, or Obsidian notes, and now you need a .docx out the other end. Here are five ways to do it, free, from fastest to most customizable, plus how to get the edited file back into Markdown once your reviewers are done.
1. Browser Copy-Paste (Fastest, Zero Install)
If you just need a one-off conversion and don't care about pixel-perfect styling, open the Markdown file somewhere that renders it as a formatted web page (GitHub's file view, for example), copy the rendered text, and paste it directly into Word or Google Docs.
- Open the rendered (not raw) Markdown view.
- Select the rendered text, from the first heading to the end, and copy it.
- Paste into a new Word or Google Docs document.
Because you copied the rendered page rather than the raw file, headings, bold and italic text, and bullet lists arrive as formatting, not as literal # and ** characters. Word keeps the source formatting by default when you paste, and Google Docs has a separate Paste without formatting command (Ctrl+Shift+V) for when you don't want it. Tables and fenced code blocks are the parts worth double-checking after the paste.
2. Pandoc (Best for Scripting and Batch Jobs)
Pandoc is the standard open-source document converter, and Markdown to DOCX is one of its core supported conversions:
# macOS
brew install pandoc
# Debian/Ubuntu (the distro package can lag behind the latest release)
sudo apt install pandoc
Then convert:
pandoc notes.md -o notes.docx
Unlike Markdown to PDF, which by default needs a LaTeX engine, this path needs nothing else installed: Pandoc writes the DOCX itself. If you want consistent fonts and heading styles instead of Pandoc's defaults, point Pandoc at a reference document:
pandoc notes.md -o notes.docx --reference-doc=template.docx
where template.docx is a Word file with your preferred styles set up. Pandoc ignores its content but uses its styles and page setup (margins, page size, header and footer). For best results, start from Pandoc's own default, pandoc -o template.docx --print-default-data-file reference.docx, and change its styles in Word. This makes Pandoc the right call when you're converting many files in a script, a CI job, or a build pipeline, and need the output to match a house style every time.
3. markdown-docx (Node.js CLI, Good for Automation)
markdown-docx is an open-source npm package (MIT-licensed, currently at version 1.7.1) that converts Markdown straight to .docx without touching Pandoc or LaTeX at all:
npx markdown-docx -i notes.md -o notes.docx
That writes notes.docx; leave out -o and it reuses the input filename with a .docx extension. Its README lists support for tables, lists, code blocks, images (downloaded automatically when they're URLs) and LaTeX math via KaTeX, and a -t/--theme flag takes inline JSON to override fonts, colors and sizes. That makes it a good fit for Node.js projects and CI pipelines where you're already comfortable with npm dependencies and want more styling control than Pandoc's defaults without hand-building a reference document.
4. VS Code "Markdown Docx" Extension (Best for Writers on Windows)
If you write Markdown in VS Code on Windows already, the Markdown Docx extension (free, currently version 0.0.7, with Windows 10 listed as its requirement) adds export directly in the editor:
- Install the extension from the Extensions panel.
- Right-click your
.mdfile in the Explorer (or inside the open editor). - Select "Convert Docx" from the context menu.
It can convert a whole file or just the text you've selected, and shows progress and warnings in an output panel. No terminal needed, which makes it a reasonable default if you want something that works without leaving the editor. Its listed known issues are worth reading first: inline math, raw HTML and block quotes don't convert yet. The same extension has an experimental mode for exporting to PowerPoint (.pptx) if you need slides instead of a document.
5. Online Converters (Good for a One-Off, No Install)
If you don't want to install anything, browser-based converters that accept a .md upload and return a .docx exist and show up for this exact search. They're convenient for a single quick conversion. For anything recurring, or for documents containing sensitive content, prefer a local tool (options 2 to 4 above). Uploading files to a third party adds a dependency and a privacy tradeoff you don't need for something Pandoc or a CLI tool can already do offline.
The Round Trip: Getting the Reviewed File Back to Markdown
A common reason to export Markdown to Word is review: a client or editor marks the document up in Word. When the edited .docx comes back and your source of truth is still Markdown, you need to convert in the other direction, and that is the direction file2markdown handles. Upload the .docx (start at the Word to Markdown converter) and get clean Markdown back, no install required. Before you upload, accept or reject the tracked changes in Word, otherwise the output can mix old and new text. Word comments are not carried over and embedded images are not extracted, and legacy .doc files need saving as .docx first.
It works the same for Word documents that never started as Markdown (contracts, reports, meeting notes) when you need them in an LLM prompt or a RAG pipeline, and the same upload takes PDF, XLSX, PPTX and several other formats. See our Word to Markdown guide for what converts cleanly and what doesn't, or Pandoc Alternatives if you've hit Pandoc's limits going that direction.
Choosing Between Them
| Method | Install needed | Best for |
|---|---|---|
| Browser copy-paste | None | One-off, informal documents |
| Pandoc | Pandoc CLI | Scripts, CI, batch jobs, house styles |
| markdown-docx | Node.js | Automation with theme/style control |
| VS Code extension | VS Code on Windows | Writers already in the editor |
| Online converter | None | Single quick conversion, non-sensitive content |
If you're converting documents into Markdown for an AI workflow afterward, see our guide on chunking Markdown for vector databases. And if you need the PDF version instead of Word, we cover that too: Markdown to PDF Converter.
Frequently Asked Questions
Can I convert Markdown to Word without installing anything?
Yes. Open the file somewhere that renders it as a web page (GitHub's file view, for example), copy the rendered text, and paste it into Word or Google Docs. Because you copied formatted text, headings, bold, and lists come along with it. Tables and code blocks are the parts most likely to need a manual touch-up afterward.
Does Pandoc need a reference document to convert Markdown to DOCX?
No. pandoc notes.md -o notes.docx works on its own and produces a usable Word file with Pandoc's default styles. A --reference-doc is only needed if you want the output to match a specific house style (custom fonts, heading colors, margins) instead of those defaults.
Will tables and code blocks survive the conversion?
With Pandoc and markdown-docx, yes: both turn standard Markdown tables into Word tables and keep code blocks as code. Pandoc also syntax-highlights fenced code blocks that are tagged with a language, by default, in DOCX output. The VS Code extension's page doesn't say either way, so check its output. Browser copy-paste is the least predictable route for tables and code blocks.
What's the best tool if I need to go from Word to Markdown instead?
That's a different problem, since the converter has to strip out Word's styling and reconstruct plain structure. file2markdown converts DOCX, PDF, XLSX, PPTX, HTML, EPUB, and more to Markdown (not the other way round), with a free online converter (5 conversions a day without an account) and an MCP server for automating it from Claude, Cursor, and other AI agents.
The Markdown Memo
A fortnightly note for lawyers, researchers, accountants, and anyone else drowning in PDFs, scans, and decks. No spam.