Article

# Markdown to Word: Convert MD to DOCX and PDF

Alexander Machulin·March 6, 2025·3 min read

The fastest way to convert Markdown to Word is to paste your MD text into [Gramax](https://gram.ax/), 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](https://gram.ax/resources/blog/en/simplify-markdown/markdown-format).

## How to convert Markdown to DOCX or PDF in 3 steps

1.  Open [app.gram.ax](https://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.

If you export Markdown regularly

Keep manuals, specs, and team guidelines in one [project documentation](https://gram.ax/solutions/project-documentation) catalog: files stay in Markdown, export to Word or PDF with a [custom template](https://gram.ax/features/export), and publish as a [public docs portal](https://gram.ax/solutions/public-documentation).

[**Start for free**](https://app.gram.ax/) · [Explore Gramax](https://gram.ax/)

## 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](https://gram.ax/resources/docs/en/collaboration/export-docx-pdf/add-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](https://gram.ax/resources/docs/en/collaboration/export-docx-pdf/ci-cd).

 |
| 

Which Markdown to Word converter should I choose?

 | 

One file, right now — the web app at [app.gram.ax](https://app.gram.ax/): paste, check, export.

Command line — [Pandoc](https://pandoc.org/) (`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.

 |

What's next: keep your documents in one catalog

If you regularly build documents from Markdown — instructions, policies, descriptions, — keep them in one Gramax catalog. That's already a knowledge base: the files stay in Markdown in your own repository, [DOCX and PDF export](https://gram.ax/features/export) works in one click, and the AI agent answers questions across all the documents at once.

How it works — see [AI that works from your documents](https://gram.ax/resources/blog/en/docs-as-code/notebooklm-alternative).

## 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](https://gram.ax/pricing)

[Explore Gramax](https://gram.ax/) [Start for free](https://app.gram.ax/?utm_source=gramax&utm_medium=blog_cta&utm_campaign=blog&utm_content=utility)
