How to Export Markdown to PDF, HTML, and Word
Convert markdown to PDF, HTML, DOCX, and other formats using pandoc, online tools, and specialized apps. Learn when to use each format and the best workflows for your needs.
How to Export Markdown to PDF, HTML, and Word
Markdown is wonderful for writing, but sooner or later you need to share your work in other formats. Your manager asks for a Word document. Your client wants a PDF. Your website needs HTML. If you're writing in markdown, you have several excellent options for exporting to other formats—each with its own strengths.
Why Export Markdown?
Plain-text markdown is portable and future-proof, but most people outside the tech world use Word, Google Docs, or PDF. You might need to:
- Submit work to colleagues in DOCX format
- Create a downloadable PDF guide or ebook
- Publish markdown to a website
- Archive formatted copies alongside your source files
The key is choosing the right tool and format for your audience and use case.
Pandoc: The Universal Converter
Pandoc is the gold standard. It's a command-line tool that converts between nearly every document format you can imagine. Install it via Homebrew:
brew install pandoc
Then convert any markdown file with a single command:
# To PDF
pandoc input.md -o output.pdf
# To Word (DOCX)
pandoc input.md -o output.docx
# To HTML
pandoc input.md -o output.html
Pandoc respects markdown syntax, preserves formatting, and handles complex documents with citations, footnotes, and tables. For serious document conversion, it's hard to beat.
Advanced Pandoc Options
Pandoc supports templates, CSS, and metadata. For example, to convert with custom styling:
pandoc input.md --css=styles.css -o output.html
pandoc input.md --pdf-engine=xelatex -o output.pdf
You can even generate professional PDFs with LaTeX, control margins, add headers and footers, and embed fonts. See the Pandoc documentation for the full range of options.
Online Conversion Tools
If you don't want to install software, several free online tools convert markdown to other formats:
- Markdown to PDF — Simple, no account required
- CloudConvert — Supports many formats, free tier available
- Pandoc Online — Pandoc in your browser
- Dillinger — Write and export markdown directly
These tools are convenient for occasional conversions, but they require uploading your file and may have size limits. For regular workflows, a command-line tool is faster.
Native Mac Apps
Several macOS apps handle markdown export natively:
Markdown Editors with Export:
- iA Writer — Export to Word, PDF, and HTML
- Bear — PDF export built-in
- Ulysses — Native PDF, Word, and EPUB export
- Typora — WYSIWYG editor with export options
These apps are convenient if you're already writing in them, but they tie you to their ecosystem.
Reading and Rendering in OpenMark
Before you export, remember that OpenMark renders markdown beautifully on macOS. You can use it as a focused reading tool—toggle dark mode, adjust text size, and read your markdown without distractions. This is useful for proofreading before export, or simply for enjoying your writing in a clean, distraction-free environment.
OpenMark's live preview means you see exactly how your markdown will render before you convert it to another format.
Choosing the Right Format
PDF — Best for final, read-only documents (reports, guides, ebooks). Looks the same on every device.
DOCX (Word) — When collaborators need to edit in Microsoft Office. Maintains compatibility but may lose some formatting nuances.
HTML — For websites, email newsletters, and documents that need styling flexibility. Markdown converts cleanly to semantic HTML.
EPUB — For ebooks and long-form reading. Many Markdown tools support EPUB via Pandoc.
Workflow Tips
-
Version control your source — Keep the
.mdfile in git. Export PDFs and DOCX files as needed, but treat them as artifacts. -
Use templates — Create Pandoc templates for documents you generate regularly (reports, invoices, etc.). Save time on formatting.
-
Separate content from style — Write pure markdown. Apply styling only at export time via CSS, templates, or Word templates.
-
Automate exports — Use a shell script or GitHub Actions to auto-convert markdown to multiple formats whenever you push to your repo.
-
Proofread in your reader — Before exporting, read your markdown in a focused tool like OpenMark. Fresh eyes catch errors.
Conclusion
Markdown is a bridge format. It lets you write once and export to any format your audience needs. Pandoc is the most powerful and flexible option, especially for batch conversions and complex documents. For quick one-off exports, online tools work fine. For daily writing, pair OpenMark's focused editing with Pandoc's conversion power.
Your markdown stays portable and yours—no vendor lock-in, no proprietary formats, just clean text that can become anything.
Ready to write in markdown? Download OpenMark — a beautifully simple native markdown editor for macOS.
Related: Learn about why developers are choosing plain text over tools like Notion.