Markdown to PDF Converter

Paste Markdown on the left, watch the preview on the right, and download a paginated PDF with selectable text — nothing ever leaves your browser.

Free · No sign-up · Runs in your browserLast updated

How do you convert Markdown to PDF?

Paste your Markdown into the converter above, choose a page size, and click Generate PDF — the file downloads straight from your browser with real, selectable text. On the command line, pandoc report.md -o report.pdf does the same job locally, once Pandoc and a PDF engine are installed.

markdown
pandoc report.md -o report.pdf

Pandoc reads report.md and writes a paginated report.pdf beside it, with headings, lists, tables and code blocks laid out for print.

Try the Markdown to PDF Converter

Settings

Page size
Orientation

Markdown

Preview

Markdown to PDF Example

Welcome to MDUtil's Markdown to PDF Converter!

Features

  • Convert Markdown to PDF with selectable text
  • Real-time Markdown preview
  • Code syntax highlighting
  • Support for tables, lists, and other elements
  • Customize page size and orientation
  • Download generated PDF instantly

Code Example

function generatePdf() {
  console.log("Converting Markdown to PDF...");
}

Table Example

FeatureSupportedExample
Headings# Heading 1
BoldBold text
ItalicItalic text
Lists- Item 1
Code blockscode

Tip: Edit the Markdown in the left panel, preview in the middle, and click "Generate PDF" when ready.

Math Formula Example

  • Quadratic Formula: x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
  • Einstein's Energy-Mass Equivalence: E=mc2E = mc^2

Four ways to convert Markdown to PDF

Every route below produces a PDF, but they differ in install cost, styling control and how faithfully they reproduce your Markdown. Pick the one that matches how often you need to do this.

In the browser (no install)

The fastest option: drop Markdown into the editor above, confirm the preview, and download. Useful for one-off documents, and the only option on a locked-down machine where you cannot install a toolchain.

markdown
# Quarterly Report

## Highlights

- Revenue up 12% quarter over quarter
- Churn down to 1.8%

| Metric | Q1  | Q2  |
| ------ | --- | --- |
| MRR    | 82k | 94k |

A PDF whose headings, bullet list and table are laid out on an A4 page, with text you can select, copy and search.

Pandoc with a LaTeX engine

The highest-fidelity route and the one most people mean by “pandoc markdown to pdf”. It gives you real typesetting, automatic tables of contents, citations and cross-references.

markdown
pandoc report.md -o report.pdf \
  --pdf-engine=xelatex \
  --toc \
  -V geometry:margin=1in

A typeset PDF with a generated table of contents and one-inch margins. Requires a TeX distribution — TeX Live, MacTeX or MiKTeX — which is 1–4 GB on disk.

Pandoc without LaTeX

If you do not want a multi-gigabyte TeX install, point Pandoc at an HTML-based engine instead. You then style the PDF with an ordinary CSS stylesheet rather than LaTeX macros.

markdown
pandoc report.md -o report.pdf \
  --pdf-engine=weasyprint \
  --css=print.css

The same document rendered through HTML and CSS, so @page rules, margins and web fonts in print.css control the final layout.

VS Code (Markdown PDF extension)

Best when the Markdown already lives in your repository. Install the Markdown PDF extension, then export the active file without leaving the editor. These workspace settings pin the output format.

markdown
// .vscode/settings.json
{
  "markdown-pdf.type": ["pdf"],
  "markdown-pdf.format": "A4",
  "markdown-pdf.displayHeaderFooter": true
}

Running “Markdown PDF: Export (pdf)” from the command palette writes report.pdf next to report.md. The first export is slow because the extension downloads a bundled Chromium.

Node CLI for batch conversion

When you need to convert a whole docs folder in CI rather than one file by hand, a Node converter with a glob is the least ceremony.

markdown
npx md-to-pdf report.md
npx md-to-pdf --stylesheet print.css "docs/**/*.md"

The first command emits report.pdf. The second converts every Markdown file under docs/ using a shared print stylesheet.

Forcing a page break

Markdown has no page-break syntax at all, which is the single most common surprise when converting to PDF. Raw HTML is the portable workaround.

markdown
The summary ends here, on page one.

<div style="page-break-after: always;"></div>

# Appendix A

HTML- and Chrome-based converters start “Appendix A” on a new page. LaTeX and plain-text PDF renderers ignore the div, so verify before you rely on it.

Markdown to PDF: which method to use

The right converter depends on whether you value zero setup, exact typography, or repeatability in a build pipeline. This is how the common options actually behave.

PlatformSupportNotes
This converterInstantNo install, no upload. Page size and orientation are configurable; fonts and margins are not.
PandocFull controlBest fidelity, TOC and citations, but needs a separate PDF engine installed.
VS CodeGoodMarkdown PDF extension exports the open file; bundles its own Chromium on first run.
ObsidianBuilt inFile → Export as PDF renders exactly what the note pane shows, theme included.
TyporaBuilt inFile → Export → PDF, with templates for headers, footers and page numbers.
Browser printPartialCmd/Ctrl+P on any rendered Markdown page. Free, but page breaks and backgrounds are unpredictable.
GitHub / GitLabNoneNeither offers a PDF export. Print the rendered README, or paste the source into a converter.

How to convert Markdown to PDF with this tool

  1. Add your Markdown

    Type or paste Markdown into the editor on the left, or use the import button to load an existing .md file from your computer.

  2. Check the live preview

    The right pane re-renders as you type. Leave Sync Scroll enabled so the preview follows your cursor through long documents.

  3. Set the page format

    Pick A4, Letter or A3, then portrait or landscape, matching wherever the document will be printed or filed.

  4. Generate the PDF

    Click Generate PDF. The document is built in your browser and downloads immediately, with text you can select and search.

Frequently Asked Questions

Is the text in the generated PDF selectable and searchable?

Yes. The converter writes real text objects rather than rasterising the preview into an image, so you can select, copy, search and index the finished PDF exactly as you would any other text document.

Should I use Pandoc or an online Markdown to PDF converter?

Use Pandoc when you convert regularly, need a table of contents, citations or precise typography, and do not mind installing a PDF engine. Use an online converter for one-off documents, for machines where you cannot install software, and when you want the result in a few seconds.

How do I convert Markdown to PDF in VS Code?

Install the Markdown PDF extension, open the file, then run Markdown PDF: Export (pdf) from the command palette. Without an extension you can open the built-in preview, right-click it and print to PDF, which is lower fidelity but needs nothing installed.

Is my Markdown uploaded to a server?

No. Both the preview and the PDF generation run in your browser using JavaScript. Nothing is transmitted, stored or logged, which makes the tool safe for internal notes, drafts and client work.

How do I force a page break in a Markdown to PDF conversion?

Markdown itself has no page-break syntax, so you insert raw HTML: a div carrying the CSS declaration page-break-after: always. Converters that render through HTML honour it; LaTeX-based ones ignore it, so always check the output.

Do images appear in the exported PDF?

Images render in the live preview. The downloaded PDF concentrates on text content — headings, paragraphs, lists, tables, code blocks and quotes — so the file stays small and fully selectable. For image-heavy documents, print the preview to PDF from your browser instead.

Do tables, code blocks and math formulas convert correctly?

Tables, fenced code blocks, blockquotes and both list types are laid out in the PDF. LaTeX math renders in the preview but is carried into the PDF as plain text, so for equation-heavy papers Pandoc with XeLaTeX is the better choice.

Why is my Chinese, Japanese or Cyrillic text missing from the PDF?

The standard PDF base fonts only contain Latin glyphs, so non-Latin scripts can drop out. Convert with Pandoc and XeLaTeX using a font that ships those glyphs, such as Noto Sans CJK, or print the preview pane from your browser, which uses your system fonts.

Can I convert a PDF back to Markdown?

Not with this tool, which is one-way. PDF to Markdown is a much harder problem because a PDF stores positioned glyphs rather than document structure, so headings, lists and tables have to be inferred. Dedicated extractors such as MarkItDown or Marker do a reasonable job.

How large a document can I convert?

There is no imposed limit, but generation happens on the browser's main thread, so a several-hundred-page document takes noticeably longer and briefly uses more memory. Splitting very large manuals into chapters keeps conversion responsive.