Skip to content
Markdown to PDF

How to Convert Markdown to PDF Online Free (3 Easy Ways)

How to convert Markdown (.md) files to PDF — free online in your browser, with VS Code, or with Pandoc — plus how to add page numbers, a table of contents and clean page breaks.

Updated · 6 min read

Markdown is great for writing, but sooner or later someone asks for “a PDF”. Here are three ways to convert a .md file to PDF, from zero-install to fully scripted, and the settings that make the result look professional.

Option 1: Convert Markdown to PDF online (fastest, no install)

  1. Open the free online Markdown to PDF converter.
  2. Paste your Markdown, or drag your .md file onto the page.
  3. Click Style to choose a theme, paper size and margins.
  4. Click Download PDF and pick Save as PDF as the destination.

Everything happens on your device — the file isn’t uploaded — and the PDF contains real, selectable text with working links.

Best for: one-off documents, READMEs, notes, AI answers, resumes.

Option 2: VS Code with an extension

If you already write in VS Code, a Markdown-to-PDF extension can export the current file. Most of them bundle a copy of Chromium, so the first export downloads a large browser. Styling usually means writing your own CSS file.

Best for: developers who export the same kind of document often.

Option 3: Pandoc on the command line

Pandoc converts Markdown to PDF through LaTeX:

pandoc notes.md -o notes.pdf --toc -V geometry:margin=2cm

It produces beautiful typesetting, but you need a LaTeX distribution installed (several gigabytes), and HTML inside your Markdown or Mermaid diagrams won’t render without extra filters.

Best for: academic writing and automated build pipelines.

Make the PDF look professional

Whichever method you choose, a few settings make a big difference:

Setting Why it matters
Page numbers Readers can reference pages in feedback
Table of contents Long documents become navigable
Margins of 18–25 mm Comfortable reading and room for notes
Page breaks before major sections Chapters start on a fresh page
Code blocks that don’t split Snippets stay readable

In the browser editor, all of these live under Style: turn on Header & footer for Page {page} of {pages}, Table of contents under Document, and Start a new page before → Each H1.

Common problems

  • Images missing: relative paths like ./img/a.png can’t be resolved from pasted text. Use full URLs, import the README by link, or drag the image into the editor to embed it.
  • Equations show as code: make sure math is wrapped in $…$ or $$…$$ (\(…\) and \[…\] work too).
  • Browser adds a URL and date to the pages: untick Headers and footers in the print dialog.

Try it on your own document

Free, private and right in your browser — no signup.

Open the editor