All articles

Markdown to Word: Convert MD to DOCX and PDF

The fastest way to convert Markdown to Word is to paste your MD text into Gramax, check how it looks and export it to DOCX or PDF. It works in the browser, it is free and does not require installing anything. If this format is new to you, start with what is Markdown.

How to convert Markdown to DOCX or PDF in 3 steps

  1. Open app.gram.ax and click Create New to add a new catalog.
  2. Click Source text in the bottom toolbar and paste the content of your MD file.
  3. Turn off Source text and check that the formatting looks right. If everything is fine, click the three dots next to the article in the left panel and select Export, then choose DOCX or PDF. The file will be saved to your computer.

Headings, lists, tables, code blocks and links are converted into native Word elements, so the document stays editable after export.

Frequently asked questions

Question

Answer

How do I paste Markdown into Word?

If you paste raw Markdown into Word, you get the markup characters (#, **, -) as plain text instead of formatting.

To get proper headings and lists, convert the text first: paste it into Gramax, export to DOCX and open the result in Word. From there you can copy any fragment into your existing document with formatting preserved.

How do I convert several MD files into one Word document?

Put the files into one catalog as articles and sections, then click the three dots next to the search icon and select Export. Gramax builds a single DOCX or PDF from the whole catalog and keeps the section structure as document headings.

To export a single section, click the three dots next to it in the left panel and select Export.

Can I export to my own Word template?

Yes. For DOCX, prepare a .docx or .dotx template in Word with your styles, title page and headers/footers, and add the {{gramax_content}} placeholder where the article text should go. For PDF, the appearance is described in a CSS file.

When exporting, select the template from the list. See how to set up a custom template.

How do I export Markdown to DOCX automatically in CI/CD?

If the documentation lives in the same repository as the code, you can generate a DOCX on every build with Gramax CLI: npx gramax-cli export -f docx -o artifacts/export -y -t ./my-template.docx.

For PDF, use -f beta-pdf; the flags --pdf-title, --pdf-toc and --pdf-number add a title page, a table of contents and heading numbering. A ready-made .gitlab-ci.yml example is in the documentation.

Which Markdown to Word converter should I choose?

One file, right now — the web app at app.gram.ax: paste, check, export.

Command line — Pandoc (pandoc input.md -o output.docx) works well if you are fine without a visual preview.

Regular documentation in Markdown — keep the sources in Git and export DOCX and PDF from Gramax with your own template or automatically in CI/CD.

Turn your Markdown files into a team knowledge base

Write Markdown like in Word, store docs in Git, or build a Cloud knowledge base with an AI agent. Up to five editors free, readers unlimited

Plans for teams and free Open Source

Let's discuss your documentation

Tell us where your docs live today — Confluence, GitBook or folders of files. We'll show how they would work in Gramax and what it would cost