Tutorial·6 min read

3 Ways to Convert Markdown to Word from VS Code

VS Code has no built-in DOCX export. Compare the three real options — Pandoc in the terminal, converter extensions, and the browser route — with setup commands and trade-offs.

If you write documentation, READMEs, or specs in VS Code, at some point you need to hand someone a Word file. Surprise: VS Code has no built-in Markdown-to-DOCX export. The Markdown preview is read-only, and "Save As" won't help.

Here are the three ways that actually work, from most to least setup.

Option 1: Pandoc from the integrated terminal

The classic developer approach. Install Pandoc once:

# macOS
brew install pandoc

# Windows
winget install --id JohnMacFarlane.Pandoc

# Ubuntu/Debian
sudo apt install pandoc

Then, in the VS Code terminal (`Ctrl+``):

pandoc README.md -o README.docx

Want consistent corporate styling? Create a reference document once and reuse it:

pandoc README.md --reference-doc=company-style.docx -o README.docx

Pros: scriptable, works offline, ideal for Makefiles and CI jobs. Cons: no preview before export; Mermaid diagrams and syntax-highlighted code need extra filters (mermaid-filter requires a Node toolchain); every machine that runs the workflow needs Pandoc installed.

You can wire this into a VS Code task (.vscode/tasks.json) so Ctrl+Shift+B exports the current file:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Markdown to Word",
      "type": "shell",
      "command": "pandoc",
      "args": ["${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.docx"],
      "group": { "kind": "build", "isDefault": true }
    }
  ]
}

Option 2: A VS Code extension

Marketplace extensions like vscode-pandoc or Docs to Markdown/Word helpers add a right-click "Export" command. Under the hood, almost all of them shell out to Pandoc — the extension is a convenience wrapper, not a converter.

Pros: no terminal commands to remember; per-file right-click workflow. Cons: you still must install Pandoc separately; extension quality and maintenance vary; configuration for styles and filters happens in settings JSON, which is arguably more fiddly than the raw command.

If you're going to install Pandoc anyway, Option 1 with a task is usually cleaner and more debuggable.

Option 3: The browser route (no installation)

For occasional exports — or on a machine where you can't install software — skip the toolchain:

  1. Select all in your .md file (Ctrl+A, Ctrl+C).
  2. Paste into the free online Markdown to Word converter.
  3. Verify the live preview and download the .docx.

Pros: zero setup, live preview before export, and it renders Mermaid diagrams and LaTeX math that raw Pandoc drops without plugins. Conversion happens client-side in the browser, so the content isn't uploaded anywhere. Cons: manual step per document — not for batch jobs.

Which should you use?

Situation Best option
CI pipeline / batch export of docs folder Pandoc (terminal or task)
Frequent single-file exports, team standard template Pandoc + --reference-doc
Occasional exports, no admin rights, or docs with Mermaid/math Browser converter
You want a right-click menu and accept the setup Extension

A common hybrid: keep Pandoc in CI for the automated docs build, and use the browser converter for ad-hoc "can you send me that as a Word file?" requests — the ones that always arrive five minutes before a meeting.

Convert your Markdown to Word now

Tables, Mermaid diagrams, and LaTeX math — all preserved. Free, no sign-up, runs in your browser.

Open the converter