The quickest way to turn Markdown into a Word document, PDF or HTML page is to paste it into a converter that renders it and exports the format you need. Our free Markdown to File converter does this in the browser, with dedicated pages for Markdown to Word, Markdown to PDF and Markdown to HTML. For repeatable conversions in scripts, Pandoc is the standard command-line tool. This guide covers both, plus the formatting problems that most often go wrong.

Why this comes up so often now

Markdown used to be mostly for developers and README files. Today a lot of it comes from AI assistants such as ChatGPT and Claude, which usually format their answers in Markdown: headings, bullet lists, tables and code blocks. Pasting that straight into Word or an email leaves stray # and ** characters behind. Converting it properly keeps the formatting and removes the symbols.

Markdown to Word (.docx)

A good conversion produces real Word formatting, not text that only looks formatted:

Our Markdown to Word converter writes a native .docx file with those properties in the browser. Images become placeholders, because a browser cannot download most images from other websites, so add them in Word afterwards. The file also opens in Google Docs and LibreOffice.

With Pandoc installed, the command-line equivalent is:

pandoc notes.md -o notes.docx

Pandoc can also apply your own fonts and styles with --reference-doc=template.docx, which is useful when documents must follow a house style.

Markdown to PDF

There are two common routes. The first renders the Markdown as a styled HTML page and prints it to PDF with the browser; this is what our Markdown to PDF converter does. It keeps text selectable, needs no installation and never uploads the document. In the print dialog, choose Save as PDF, set the paper size and margins, and turn off Headers and footers to remove the date and page address some browsers add.

The second route is Pandoc, which produces PDF through a LaTeX engine by default, so a LaTeX distribution must be installed. It gives fine control over typesetting and suits long technical documents. Many Markdown editors, such as Obsidian, can also export straight to PDF.

Markdown to HTML

Decide first whether you need a complete page or just the content. A complete page includes the HTML document wrapper, a title and CSS, and can be opened or hosted as it is. Just the body is what you paste into a CMS, email builder or template that already has its own styles. Our Markdown to HTML converter offers both.

If the Markdown comes from someone else, including an AI tool, sanitise the HTML before publishing it. Markdown allows raw HTML, so it can carry scripts or javascript: links. Our converter runs every export through DOMPurify, which removes them.

Which method to choose

MethodBest forInstall neededDocument leaves your machine
Browser converter (ours)One-off documents, AI answers, quick exports to Word, PDF or HTMLNoNo, it runs in the browser
PandocScripts, batch conversion, house styles, long technical documentsYes (plus LaTeX for PDF)No
Markdown editor exportWriters who already draft in an editor such as ObsidianYesNo
Online converters that upload filesOccasional use with non-sensitive textNoYes, check their privacy terms

For anything confidential, such as contracts, client data or internal plans, prefer a method that keeps the document on your machine.

Keeping a consistent house style

If documents must match a company template, keep the Markdown plain and let the conversion apply the styling. With Pandoc, save a Word file whose Heading, Normal and Table styles look the way you want and pass it with --reference-doc. With a browser converter, open the result in Word and apply your template's styles; because the headings are real Heading styles, the new look applies in one step.

Fixing the formatting that goes wrong

Tables that do not render

A Markdown table needs a header row followed by a separator row of dashes. Without the separator line it is just text. Colons in the separator set the alignment; this one right-aligns the price column:

| Plan | Price |
| --- | ---: |
| Starter | $29 |
| Team | $99 |

Nested lists that flatten

Sub-items must be indented under their parent item, usually by two to four spaces, consistently. Mixed tabs and spaces are the most common cause of lists collapsing into one level.

Lines that run together

A single line break inside a paragraph is treated as a space. Leave a blank line between paragraphs, or end a line with two spaces or a backslash for a hard line break.

Code that loses its formatting

Wrap code in three backticks on their own lines, and add the language after the opening backticks (for example json or python) so HTML output can be syntax highlighted.

Going the other way
Need to turn a PDF, Word file or web page into Markdown, for example to give it to an AI assistant or index it for search? Use the File to Markdown converter, and see how to convert PDF and Word files to Markdown for RAG.