Skip to main content

Free · runs in your browser

Markdown to Word converter: export .md as .docx

To convert Markdown to Word, open the .md file in Markdown Lens and choose Export → Export Word (.docx). Headings become Word heading styles, lists get real Word numbering, and tables, links, and images stored with the document carry over. It is free, and the .docx is built in your browser, so the file is never uploaded.

Markdown Lens is the free, open-source editor this site builds. Below you will also find the two free alternatives most people use, Pandoc and Google Docs, with what each one is good at.

Compare formats

Or drop a file on this page. It stays in this browser.

Drop a file here

Markdown

  1. 1Open a .md file or paste Markdown into the editor.
  2. 2Check the preview: it shows what goes into the Word file.
  3. 3Choose Export → Export Word (.docx).

Real output

Example: what a Markdown file becomes in Word

This is the paragraph-by-paragraph result of running Markdown Lens's Word exporter on this file, read back from the generated word/document.xml. The left column is the Word style each paragraph gets, so you can restyle the whole document from Word's Styles pane.

release-notes.mdMarkdown source

  • # Release notes 2.1
  • The **Word export** keeps [the summary](#whats-new) as a working link.
  • ## What's new
  • 1. Export to Word (.docx)
  • 2. Page size follows the PDF setting
  • | Feature | Status |
  • | :--- | ---: |
  • | Tables | Shipped |
  • - [x] Draft notes
  • - [ ] Review
  • ```bash
  • npm run build
  • ```
  • Math stays as source: $E = mc^2$[^1]
  • [^1]: Rendered as text in Word.

Word paragraphs and styles

Heading 1        Release notes 2.1
Normal           The Word export keeps the summary as a working link.
                 (an internal hyperlink to the "What's new" heading)
Heading 2        What's new
List Paragraph   1. Export to Word (.docx)
List Paragraph   2. Page size follows the PDF setting
Table            Feature | Status     (bold header row, repeats on each page)
                 Tables  | Shipped    (Status column right-aligned)
List Paragraph   ☑ Draft notes
List Paragraph   ☐ Review
Code Block       npm run build
Normal           Math stays as source: $E = mc^2$¹
                 ────────────────────
Footnote Text    1 Rendered as text in Word.

What the converter preserves

  • Headings 1–6 as Word's Heading 1–6 styles with outline levels, so the Navigation pane and a Word table of contents pick them up
  • Bold, italic, strikethrough, and inline code (as an Inline Code character style)
  • Links as real Word hyperlinks; links to #headings jump to that heading inside the document
  • Numbered and bulleted lists with Word numbering, including start numbers and nested levels
  • Tables as Word tables with a bold header row that repeats on every page and per-column alignment
  • Images stored with the document, embedded in the .docx and scaled to fit the page
  • Code blocks in a monospaced Code Block style with every line break kept
  • The document title in the file properties, and an A4 or US Letter page with 1-inch margins

Limitations to review

Word can show more than Markdown describes, but a few Markdown features have no direct Word equivalent in this export.

  • Math ($…$ and $$ blocks) stays as LaTeX source in code formatting; it does not become Word equations.
  • Mermaid diagrams export as their source code, not as a picture.
  • Footnotes become a numbered notes section at the end of the document, not Word footnotes at the bottom of each page.
  • Images linked by web URL are not downloaded; Word shows the alt text and the link instead.
  • Code blocks are not syntax-highlighted, and raw HTML is reduced to its text.
  • Task list items show ☑ and ☐ characters, not clickable Word checkboxes. Table columns get equal widths.

How to convert Markdown to Word in Markdown Lens

Nothing leaves your computer: the .docx is assembled in the browser from the same GitHub-flavored Markdown the preview shows. There is no account, file size quota, or watermark.

  1. Open the editor and drop your .md file on it, choose “Open a Markdown file” on this page, or paste Markdown into a new document.
  2. If your document has images, paste or drop them into the editor so they are stored with the document. Only stored images are embedded in the .docx.
  3. The page size is A4 by default. If you last printed or saved a PDF from Markdown Lens on Letter or Legal paper, the Word export uses US Letter instead.
  4. Open the Export menu and choose Export Word (.docx). On wide screens the .docx button next to Export does the same, and the command palette has Export Word (.docx) too.
  5. Open the downloaded .docx in Microsoft Word or any other app that opens Word files.

Open the Markdown editor and export to Word

What does each Markdown element become in Word?

This mapping comes from the exporter's source code and its tests, so it describes exactly what you get, including the parts that do not carry over.

Markdown elements and their result in the exported Word document
MarkdownIn Word
# Heading … ###### HeadingHeading 1–6 styles with outline levels and a bookmark for each heading
**bold**, *italic*, ~~strike~~Bold, italic, and strikethrough text
`code`Inline Code character style (Consolas, shaded)
[text](https://…)Clickable hyperlink
[text](#heading)Hyperlink that jumps to that heading's bookmark
1. item / - itemWord numbered or bulleted list, nested up to nine levels
- [x] done☑ or ☐ followed by the item text
| table |Word table, bold shaded header row repeated on each page, column alignment kept
![alt](assets/photo.png)Embedded picture scaled to the text width (PNG, JPEG, GIF)
![alt](https://…)Alt text in italics plus the link; the image is not fetched
```code```Code Block paragraph style with line breaks kept
> quoteQuote style, indented with a left border
---Horizontal rule as a bottom border
$x^2$, $$…$$LaTeX source in code formatting
[^1] footnoteSuperscript number and a notes section at the end

How to convert Markdown to Word with Pandoc

Pandoc is a free command-line converter. It picks the formats from the file extensions, so one command turns a .md file into a .docx. It is the better choice when you convert many files, run conversions in a script, or must match a company template.

To use your own fonts, margins, page size, header, and footer, print Pandoc's default reference document, change only its styles in Word (Heading 1, Body Text, Source Code, Block Text and so on), and pass it with --reference-doc. Pandoc ignores the reference document's text and copies its styles and document properties. Add -s --toc to insert a table of contents.

# Convert one file
pandoc release-notes.md -o release-notes.docx

# Make a reference document, edit its styles in Word, then use it
pandoc -o custom-reference.docx --print-default-data-file reference.docx
pandoc release-notes.md --reference-doc=custom-reference.docx -o release-notes.docx

# Add a table of contents
pandoc release-notes.md -s --toc -o release-notes.docx

How to convert Markdown to Word with Google Docs

Google's help page lists headings, bold, italic, strikethrough, and links as the supported Markdown. It does not document tables, code blocks, or footnotes, so check those after the import. The file is stored in your Google Drive.

  1. In Google Docs, open Tools → Preferences and turn on Enable Markdown.
  2. Choose File → Open → Upload and select the .md file, or right-click the file in Google Drive and choose Open with → Google Docs. You can also right-click in a document and choose Paste from Markdown.
  3. Choose File → Download and pick Word (.docx) as the file type.

Which Markdown to Word method should you use?

All three are free. Markdown Lens is our product; the comparison uses the same four questions for each method.

Markdown to Word methods compared
MethodInstallFile leaves your computerCustom Word templateBest for
Markdown LensNone, runs in the browserNoNo, restyle in Word afterwardsOne document at a time, with a live preview and images
PandocCommand-line installNoYes, with --reference-docBatches, scripts, and house templates
Google DocsNone, needs a Google accountYes, stored in Google DriveNoDocuments you will keep editing with other people

Sources

The Pandoc and Google Docs steps follow their official documentation. The Markdown Lens behavior comes from its open-source Word exporter.

Pandoc User's Guide (--reference-doc, --toc)Google: Use Markdown in Google DocsGoogle: Create, view, or download a fileMarkdown Lens Word exporter source

Quick answers

Questions about Markdown to Word

Can I convert Markdown to Word for free?

Yes. Markdown Lens exports .docx for free with no account and no watermark. Pandoc and Google Docs are free alternatives.

Is my Markdown uploaded when I export to Word?

No. Markdown Lens builds the .docx inside your browser and downloads it directly. Nothing is sent to a server.

Does the Word file keep my Markdown tables?

Yes. Each Markdown table becomes a Word table with a bold header row that repeats on every page, and left, center, or right column alignment is kept.

Can I use my company's Word template?

Not directly in Markdown Lens. The export uses named Word styles, so you can restyle the whole document from Word's Styles pane. Pandoc's --reference-doc option applies a template's styles during conversion.

Can I export Markdown to .doc instead of .docx?

The export creates .docx, which every current version of Word opens. If you need the older .doc format, open the .docx in Word and save a copy in that format.

How do I convert a Word document back to Markdown?

Use the Word to Markdown converter on this site: it turns a .docx into Markdown with headings, lists, links, tables, and images, also without uploading the file.