Why Convert Markdown to PDF?
Markdown is wonderful for writing. It's plain text, it's portable, it's easy to read even without rendering. But not everyone speaks markdown. When you need to share a document with a colleague, submit a paper, send a proposal, or print something, PDF is the universal format.
The problem is that going from markdown to PDF isn't always straightforward. You can't just rename the file and call it done. You need something to interpret the markdown, apply formatting, and generate a properly laid out PDF. The quality of that conversion makes a real difference. A good markdown to PDF tool gives you readable typography, properly sized headings, clean code blocks, and sensible margins. A bad one gives you something that looks like a web page somebody printed.
Let's walk through the best ways to convert markdown to PDF, starting with the simplest.
Method 1: Use Indent (Easiest, Free)
Indent is a free markdown editor for Mac, iPhone, and iPad that includes built in PDF export with proper typography. Here's the workflow:
Open your markdown file in Indent
Launch Indent and open your .md file. You can do this through the File menu on Mac, or through the Files app on iPhone and iPad. You can also create a new document and paste your markdown in.
Preview your document
Switch to Preview or Split mode to see how your document will look. Indent renders your markdown with proper heading hierarchy, styled code blocks, formatted lists, and clean link presentation. If anything needs adjusting, you can edit directly in the preview thanks to bi directional editing.
Export to PDF
Use the share or export function to generate your PDF. On Mac, this goes through the standard macOS share sheet. On iPhone and iPad, same thing: the iOS share sheet. The resulting PDF has proper typographic formatting, appropriate margins, and a clean layout that looks professional.
That's it. Three steps, no command line, no configuration, no cost. The PDF you get has thoughtful typography: headings are properly sized and spaced, body text uses a readable typeface, code blocks are set in a monospaced font with appropriate background styling, and the overall document has sensible margins and page breaks.
Indent is available on the App Store for free. No subscription, no in app purchases. You can use it purely as a markdown to PDF converter if you want, or as your everyday markdown editor.
Method 2: Pandoc (Command Line, Powerful)
If you're comfortable with the terminal, pandoc is the Swiss Army knife of document conversion. It can convert between dozens of formats, and markdown to PDF is one of its most common use cases.
Installing Pandoc
On Mac, the easiest way to install pandoc is through Homebrew:
You'll also need a LaTeX distribution for PDF output. The simplest option is:
Basic Conversion
Once installed, converting a markdown file to PDF is a single command:
This produces a PDF using pandoc's default LaTeX template. The output is clean and academic looking, with good typography and proper formatting.
Customization
Pandoc's real power is in its options. You can change fonts, margins, page size, and much more:
--pdf-engine=xelatex \
-V geometry:margin=1in \
-V fontsize=12pt \
-V mainfont="Helvetica Neue"
Pros: Extremely powerful and customizable. Can handle complex documents with tables of contents, citations, and custom templates. Free and open source.
Cons: Requires terminal knowledge. Needs LaTeX installed (which is a large download). No visual preview before export. Not available on iPhone or iPad.
Method 3: VS Code with an Extension
If you already use Visual Studio Code, there are several extensions that add markdown to PDF conversion.
Markdown PDF Extension
The most popular is the "Markdown PDF" extension by yzane. Install it from the VS Code Extensions marketplace, then:
- Open your markdown file in VS Code.
- Open the Command Palette (Command+Shift+P).
- Type "Markdown PDF: Export (pdf)" and select it.
- A PDF will be generated in the same directory as your markdown file.
Pros: Convenient if VS Code is already your editor. The extension is free. Supports custom CSS for styling the output.
Cons: Requires VS Code (which is an Electron app and fairly heavy). The default PDF styling is basic. No mobile option. Takes some CSS work to get a polished result.
Method 4: Marked 2 (Mac Only, Paid)
Marked 2 is a dedicated markdown preview app for Mac that includes PDF export. It doesn't edit markdown; it watches a file and renders it in real time as you edit in another app.
Pros: Excellent preview rendering. Multiple built in styles. Custom CSS support. Works alongside any text editor.
Cons: Costs $14. Mac only. Doesn't include an editor, so you need another app for writing.
Method 5: Online Converters
There are several websites that let you paste markdown and download a PDF. Dillinger, Markdown to PDF (markdowntopdf.com), and others offer this service.
Pros: No software to install. Works on any device with a browser.
Cons: You're pasting your content into a third party website. The formatting options are usually limited. The output quality varies. Some sites are ad heavy. You need an internet connection.
Comparing the Methods
| Method | Cost | Platforms | Ease of Use |
|---|---|---|---|
| Indent | Free | Mac, iPhone, iPad | Very easy |
| Pandoc | Free | Mac, Linux, Windows | Requires terminal |
| VS Code | Free | Mac, Linux, Windows | Moderate |
| Marked 2 | $14 | Mac only | Easy |
| Online tools | Free | Any (browser) | Easy but limited |
What Makes a Good Markdown to PDF Conversion
Not all markdown to PDF tools produce the same quality output. Here's what to look for:
- Typography. Headings should be properly sized relative to body text. Body text should use a readable font at a comfortable size. Line spacing should give the text room to breathe.
- Code blocks. Code should appear in a monospaced font with appropriate background styling that distinguishes it from body text. Long lines should handle gracefully, either wrapping or showing a scroll indicator.
- Lists. Nested lists should be properly indented. Bullet styles should be consistent. Numbered lists should maintain correct numbering.
- Links. In a PDF, links should either be clickable (for digital distribution) or show the URL (for print).
- Page breaks. A good converter avoids breaking headings from their first paragraph, doesn't split code blocks awkwardly across pages, and provides reasonable margins.
Indent pays attention to all of these details. The PDF output is designed to look like someone took the time to format the document properly, even though all you did was write markdown and tap export.
The HTML Export Option
While we're talking about export, it's worth mentioning that Indent also exports to responsive HTML with dark mode support. This is useful when:
- You want to share a document that the recipient can view in any browser.
- You want the document to adapt to different screen sizes.
- You prefer the way it looks on screen over how it looks on paper.
The HTML export produces a self contained file with inline styles, so you can send it to anyone and it will display correctly without any external dependencies.
Convert Your First Markdown File to PDF
If you just want to get a PDF from your markdown file as quickly as possible, Indent is the simplest path. Download it from the App Store, open your file, and export. It's free, it works on Mac, iPhone, and iPad, and the output looks good without any configuration.
If you need more control over the output or you're converting many files programmatically, pandoc is the right tool. It has a steeper learning curve, but the customization options are essentially unlimited.
Either way, you don't need to pay for a markdown to PDF conversion in 2026. The free options are excellent.
