Guide
How to Convert Markdown to PDF on Mac
Updated June 1, 2026
On a Mac you have three solid ways to turn a Markdown file into a PDF: a free browser tool that needs no install, Pandoc on the command line via Homebrew, or VS Code with an extension. The fastest path is the browser tool; the most powerful for automation is Pandoc. Here is how each works and when to use it.
Option 1: A browser tool (easiest)
If you just want a clean PDF without installing anything, MarkdownToFile.com runs entirely in your browser. Nothing is uploaded — the conversion happens client-side on your Mac, so private documents stay private.
- Open the editor in Safari, Chrome, or any browser.
- Paste or type your Markdown. The live, paginated preview is exactly what you download.
- Pick a theme (GitHub, Clean, Academic, Dark), page size (A4 or Letter), and margins.
- Click download. You get a real vector PDF with selectable text and proper page breaks.
It supports GitHub-Flavored Markdown, Mermaid diagrams, KaTeX math, task lists, footnotes, and code blocks with syntax highlighting. It does not export .docx directly — but you can Copy HTML and paste into Pages or Word if you need an editable file. It is also interactive, not a CLI, so it is not the tool for batch-converting hundreds of files.
Option 2: Pandoc via Homebrew
Pandoc is the gold standard for scripted, repeatable conversions and academic work with citations. It is a command-line tool, so there is setup involved.
brew install pandoc
brew install --cask basictex # a LaTeX engine for PDF output
pandoc input.md -o output.pdf
basictex (or full MacTeX, several GB) provides the LaTeX engine Pandoc uses to render PDFs. Once installed you can apply templates, process BibTeX bibliographies, and wire conversion into scripts or CI. The trade-off is a steeper learning curve and no visual preview.
Option 3: VS Code
If you already write in VS Code, the Markdown PDF extension (by yzane) keeps everything in your editor.
- Open Extensions, search “Markdown PDF”, install it.
- On first export it downloads a Chromium build automatically.
- Open your
.mdfile, run Markdown PDF: Export (pdf) from the command palette.
Styling is done with CSS, and Mermaid or KaTeX need extra configuration. It is convenient but heavier than a browser tool for a one-off conversion.
Comparison: effort vs power
| Method | Setup effort | Power / flexibility | Best for |
|---|---|---|---|
| Browser tool | None | Themes, Mermaid, KaTeX, A4/Letter | Quick, private, one-off PDFs |
| Pandoc + Homebrew | High (LaTeX install) | Very high (templates, citations, scripting) | Automation, academic docs |
| VS Code extension | Medium | Medium (CSS styling) | People already living in VS Code |
Bottom line
For a fast, private conversion with no install, the browser tool wins on a Mac — open it, paste, download. If you need automated pipelines, custom LaTeX templates, or bibliography handling, install Pandoc. VS Code sits in between for editor-centric workflows. On Windows or Linux instead? See Convert Markdown to PDF on Windows or on Linux.
Ready now? Open the editor and convert your Markdown to PDF in seconds.
Written by Markdown to PDF Editorial Team
Our team specializes in document design, web standards, and developer utilities. This guide was researched and vetted against current browser printing standards and Paged.js specifications. Learn more on our About page.
Try it yourself — free, no signup
Convert your Markdown to a polished PDF right in your browser.
Open the editor