Guide

How to Convert Markdown to PDF (2026 Guide)

July 4, 2026 · 4 min read

Markdown is perfect for writing — plain text, easy to version, readable anywhere. But when it's time to share a document, nobody wants a raw .md file. PDF is the universal answer: it looks the same on every device, prints cleanly, and can't be accidentally edited.

This guide covers every practical way to turn Markdown into a polished PDF, from a zero-install browser converter to command-line pipelines — and how to fix the formatting issues that usually go wrong.

The fastest way: convert in your browser

If you just want a clean PDF in under a minute, use a browser-based converter. ConvertMDapp lets you paste your Markdown (or drop a .md file), see a live preview, and click Export PDF. Because everything runs locally in your browser, your document never gets uploaded to a server — which matters for anything confidential.

  1. Open the converter.
  2. Paste your Markdown or drag in a .md file.
  3. Check the live preview on the right.
  4. Click Export PDF and save.

No signup, no watermark, no upload. This is the right choice for most people most of the time — the rest of this guide is for when you need automation or you're already living inside a specific tool.

Every method compared

Method Best for Installs anything? Offline
Browser converter Quick, private one-off conversions No Yes*
VS Code extension Developers editing docs in their IDE Yes Yes
Pandoc (CLI) Automation, batch jobs, LaTeX-quality output Yes Yes
Obsidian export Notes and personal knowledge bases No (built-in) Yes
Print to PDF Anything already rendered in a browser No Yes

*A browser converter that runs client-side works offline once the page is loaded.

Method 1 — VS Code

If you write Markdown in VS Code, the Markdown PDF extension (yzane.markdown-pdf) adds one-click export. Install it, open your .md file, run the Command Palette (Ctrl/Cmd+Shift+P) and choose Markdown PDF: Export (pdf). It renders through headless Chromium, so code highlighting and tables come out clean.

Full walkthrough, with styling tips: Export Markdown to PDF in VS Code.

Method 2 — Pandoc on the command line

Pandoc is the power-user's choice. Once installed with a LaTeX engine, a single command produces a typeset PDF:

pandoc report.md -o report.pdf

It's ideal for scripts, CI pipelines, and batch-converting whole folders. The trade-off is setup: you need a LaTeX distribution (or a different PDF engine like weasyprint) before that command works.

Method 3 — Obsidian and other note apps

Already keeping notes in Obsidian? It exports to PDF natively — open a note, then ⋯ → Export to PDF. You can set page size and margins in the export dialog. See Convert Obsidian notes to PDF for the details and gotchas.

Method 4 — Print to PDF

Any Markdown that's already rendered in a browser (a GitHub page, a preview, a docs site) can be saved with Print → Save as PDF (Ctrl/Cmd+P). It's universally available but gives you the least control over margins and page breaks — fine in a pinch, not for polished output.

Fixing the three things that usually break

Most "my PDF looks wrong" complaints come down to three culprits.

Tables

Wide Markdown tables get clipped at the page edge. The fix is a converter that constrains content to the printable page width and lets rows break cleanly. We cover this in depth in Markdown tables to PDF.

Images

Use standard Markdown image syntax and make sure the path resolves:

![Architecture diagram](./diagram.png)

Relative paths break when the converter can't find the file — absolute URLs or embedded images are safest for portability.

Page breaks

Long documents can slice a heading off from its paragraph, or cut a table row in half. Good converters use "avoid-break" rules so paragraphs, list items and table rows stay intact. If yours doesn't, you can force a break with a raw HTML divider: <div style="page-break-before: always"></div>.

Which should you use?

Working with a specific source? We have focused guides for GitHub READMEs, resumes and CVs, and Mac & Windows — plus a roundup of the best Markdown-to-PDF converters and a look at PDF vs Word.

FAQ

Is it free to convert Markdown to PDF? Yes. Browser converters, VS Code extensions, Pandoc and Obsidian's export are all free.

Can I convert without uploading my file? Yes — a client-side browser converter like ConvertMDapp does the whole conversion locally, so nothing is uploaded.

Do code blocks and syntax highlighting survive? With a good converter, yes. Highlighting is applied at render time and baked into the PDF.