How to Convert .md to PDF on Mac
4 methods — from one-click to command line
Why Convert Markdown to PDF?
Markdown files are great for writing and version control, but sometimes you need a PDF: to share a document with someone who doesn't have a Markdown viewer, to submit a report, or to print a spec. macOS makes this straightforward once you know where to look.
Method 1: Print → Save as PDF (Easiest)
This works from any app that can render Markdown — including MDViewer.
- Open the
.mdfile in a Markdown viewer - Press ⌘P to open the Print dialog
- Click PDF in the bottom-left corner
- Choose Save as PDF
- Pick a filename and location, click Save
This preserves the rendered formatting — headings, bold, code blocks, lists — exactly as they appear on screen. The output quality depends on the app you're printing from, so using a dedicated Markdown viewer gives the best results.
Method 2: Pandoc (Command Line)
Pandoc is a powerful document converter that runs in the terminal. It produces high-quality PDFs with full control over styling.
- Install Pandoc:
brew install pandoc - Install a PDF engine (if needed):
brew install --cask basictex - Convert:
pandoc README.md -o README.pdf
Pandoc supports tables, footnotes, math, and custom templates. It is the best option for batch conversion or automated pipelines.
Method 3: VS Code Markdown PDF Extension
If you already use VS Code:
- Install the Markdown PDF extension
- Open the .md file
- Open the Command Palette (⌘⇧P)
- Type Markdown PDF: Export (pdf)
Quick and convenient if VS Code is already your editor, but it launches a full IDE just to convert a file.
Method 4: grip + Chrome (GitHub-Style PDF)
If you want the output to look exactly like GitHub renders your Markdown:
- Install grip:
pip install grip - Run:
grip README.md - Open
localhost:6419in Chrome - Press ⌘P → Save as PDF
Grip renders Markdown using GitHub's API, so the output matches GitHub's styling perfectly — ideal for READMEs and project documentation.
Which Method Should You Use?
- Quick one-off? — Open in MDViewer, ⌘P, Save as PDF
- Batch conversion or CI? — Pandoc
- Already in VS Code? — Markdown PDF extension
- Need GitHub-exact styling? — grip
For most people, the Print → Save as PDF method is the fastest. You just need a Markdown viewer that renders the file well.
View Your Markdown Files with MDViewer
MDViewer is a free, native macOS app for reading and editing .md files. Open any Markdown file, see it rendered instantly, and print to PDF when you need to share.
- Renders GitHub Flavored Markdown — tables, task lists, code blocks
- Set as your default .md app — double-click in Finder to open
- Inline editing — fix and save without switching apps
- Launches instantly — native SwiftUI, no Electron overhead
Requires macOS 13.0 or later. Intel and Apple Silicon.