Markdown to PDF: 7 ways to convert, compared

Seven ways to turn Markdown into a PDF, from a free browser tool to Pandoc, VS Code, Obsidian and Mac apps, compared on setup, diagrams, math and privacy.

What matters when you pick a converter

Every converter can turn headings and paragraphs into a PDF. They differ on five things:

  • Setup. Nothing to install, an app, or a command-line tool with dependencies.
  • What renders. Tables and code are common; Mermaid diagrams, math and local images are where converters differ most.
  • Control over the page. Page size, margins, headers, page breaks and styles.
  • Batches. One document now and then, or many files in a script.
  • Privacy. Whether the file stays on your computer or goes to someone's server.

Here are seven common routes, with what each is good and bad at. This is a guide to choosing, not a benchmark: run your own document through the one you pick, and check the PDF itself.

1. A browser converter

The quickest route for one document with no installation. Paste or open the Markdown, check the rendered page, and save it through the browser's print dialog.

Good for: a quick PDF of a README, notes or an AI answer, on any computer, including private documents. Limits: page control is whatever your browser's print dialog offers, and the Aero Markdown tool shows Mermaid diagrams and math as source and doesn't load images. Many other online converters upload the file to make the PDF, so check before pasting anything private.

2. Pandoc

The command-line standard, and the most control:

Terminal
pandoc report.md -o report.pdf

By default Pandoc builds the PDF with LaTeX, which needs a LaTeX distribution installed and produces book-like typesetting with excellent math. Other engines avoid LaTeX: --pdf-engine=weasyprint styles the PDF with CSS, and --pdf-engine=typst uses Typst.

Good for: batches, scripts, academic documents, consistent styling across many files. Limits: setup, and Mermaid diagrams need an extra filter. Raw HTML in the Markdown is dropped by LaTeX.

3. VS Code with an extension

VS Code's built-in preview has no PDF export, but extensions add it. Markdown PDF is a widely used one: it renders the document with a bundled Chromium engine and exports PDF, HTML or images.

Good for: developers who already write Markdown in VS Code, with code highlighting and Mermaid support. Limits: the first run downloads the rendering engine, and styling means editing CSS settings.

4. Obsidian

Obsidian has a built-in Export to PDF command for the open note, with page size, margins and a scale option. It renders what Obsidian renders: tables, Mermaid, math and embedded images.

Good for: notes already in an Obsidian vault. Limits: Obsidian-only syntax such as wikilinks and embeds won't mean anything to readers of the PDF who expect to follow them, and you need the vault set up.

5. Typora

Typora is a Markdown editor that shows the formatted document as you write, with PDF export using its themes. It renders math and Mermaid diagrams.

Good for: writers who want an editor and a polished PDF from the same app. Limits: a paid app; styling through themes and CSS.

6. md-to-pdf and other command-line tools

Node-based tools such as md-to-pdf render Markdown with a headless browser and save a PDF, styled with your own CSS:

Terminal
npx md-to-pdf report.md

Good for: developers who want CSS styling and automation without LaTeX. Limits: needs Node.js and downloads a headless browser.

7. A Mac Markdown reader

If you read Markdown documents more often than you convert them, a reader app exports the page you're already looking at. Aero Markdown for Mac has File → Export as PDF and File → Print, and renders local images, Mermaid diagrams and KaTeX math before it exports. Exporting a Markdown document to PDF on Mac has the checklist we use.

Good for: documents you read, review and pass on regularly, offline. Limits: Mac only; a reader rather than a typesetting system, so no LaTeX-level page control.

Comparison

RouteInstallMermaid and mathPage controlBatchesFile stays local
Browser tool (this site)NoneShown as sourcePrint dialogNoYes
PandocCLI, plus LaTeX or another engineMath yes, Mermaid with a filterHighYesYes
VS Code + Markdown PDFEditor and extensionYesCSS settingsPartlyYes
ObsidianAppYesBasicNoYes
TyporaPaid appYesThemes, CSSNoYes
md-to-pdfNode.jsDepends on setupCSSYesYes
Aero Markdown (Mac)AppYesBasicNoYes
Typical upload converterNoneVariesLittleNoNo

Which one to use

  • One document, right now, any computer: a browser tool.
  • Many documents, or a pipeline: Pandoc, or md-to-pdf if you prefer CSS.
  • You write in VS Code, Obsidian or Typora: use its export; it renders what you see.
  • You mostly read Markdown on a Mac and sometimes pass it on: a reader with export.

Whatever you choose, open the PDF before sending it. Wide tables, long code lines and page breaks inside diagrams are where every converter can surprise you; reading and exporting wide Markdown tables covers the most common problem. If the recipient needs to change the document rather than read it, send the Markdown or an HTML copy as well.

Frequently asked questions

What is the easiest way to convert Markdown to PDF?

Paste the Markdown into a browser converter, such as the free Markdown to PDF tool on aeromarkdown.app, check the page and choose Save as PDF. There is nothing to install, and that tool doesn't upload the document.

How do I convert Markdown to PDF with Pandoc?

Run pandoc input.md -o output.pdf. By default Pandoc makes PDFs through LaTeX, so you need a LaTeX distribution installed; alternatively choose another engine with --pdf-engine, such as weasyprint or typst.

Which Markdown to PDF converter renders Mermaid diagrams?

Converters built on a browser engine that includes Mermaid, such as the VS Code Markdown PDF extension, Obsidian, Typora and some Mac reader apps including Aero Markdown, can export diagrams as pictures. Pandoc and simple online converters usually leave Mermaid as code unless you add a filter.

Can I convert Markdown to PDF without uploading my file?

Yes. Desktop apps, Pandoc and browser tools that convert inside the tab keep the file on your computer. Check before using an online converter: many send the file to a server to make the PDF.

Why do tables get cut off in my Markdown PDF?

A wide table doesn't fit the page width. Try landscape orientation, a smaller font in the print settings, fewer columns or shorter cell text, and check the PDF itself rather than the preview.