Markdown to PDF Converter

Type or paste Markdown on the left and a styled page appears on the right as you write. Choose one of four themes, the paper size and the margins, then press Save as PDF. Your browser's print dialog opens; pick Save as PDF as the destination and the file is made on your device.

What the converter supports
FeatureSupportedHow
Headings, lists, links, quotes, codeYesCommonMark
Tables, task lists, strikethroughYesGitHub Flavored Markdown
A4 or US Letter, custom marginsYesCSS @page rules
Raw HTML inside the MarkdownNoShown as text for safety
Selectable, searchable text in the PDFYesThe browser prints real text

Updated

Most Markdown to PDF sites upload your file, render it on their server and hand back one plain style. This page renders the Markdown in your browser with react-markdown and the GFM plugin, wraps it in a print stylesheet, and hands the page to the browser's own PDF engine. Text stays selectable, links stay clickable, and the draft never leaves the tab.

Write Markdown, save a PDF

Rendered and printed in your browser. Nothing is uploaded.

The print CSS behind the export

This is the core of what the page injects when you press Save as PDF. Copy it into your own site to make any page print cleanly.

Paper size, margins and hiding the rest of the page

The size descriptor of @page is Baseline 2024, so current browsers honour it. Everything outside the document is hidden only while printing.

@page {
  size: A4;
  margin: 18mm;
}
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  h1, h2, h3 { break-after: avoid; }
  pre, table, img, tr { break-inside: avoid; }
  a { color: inherit; }
}

How the print stylesheet works

When you press Save as PDF, the page adds an @page rule with the size and margin you chose, then hides everything except the rendered document while printing. The site header, menus and this guide never reach the PDF.

Page breaks avoid splitting a heading from the paragraph under it and try to keep code blocks, table rows and images whole. Browsers treat these as requests, so a very long code block may still break across pages.

Choosing a theme

Clean suits most notes and handouts. Book uses a serif face and wider leading for essays and letters. Technical gives code blocks a frame and uses a monospaced face for headings, which fits API docs and runbooks. Compact tightens spacing to fit more on each sheet.

How it works

  1. Write in the editor or drop a .md file onto it. The preview updates as you type.
  2. Pick a theme: Clean, Book, Technical or Compact.
  3. Choose A4 or Letter and a margin in millimetres.
  4. Press Save as PDF. In the print dialog, set the destination to Save as PDF (in Safari, use the PDF button) and save.

Tips

  • Turn off the browser's own headers and footers in the print dialog's more settings, or the date and page address print in the margins.
  • Keep Background graphics switched on in the print dialog if you want the coloured code blocks and table stripes.
  • Start each major section with a level two heading; headings are kept with the text that follows them where the browser allows.
  • For a long report, convert one section first to check the theme before you print the whole document.

Frequently asked questions

Why does a print dialog open instead of a download?

The browser's print engine makes much better PDFs than a script can: real text, working links, crisp type at any zoom. Choosing Save as PDF as the destination is the one extra step, and it keeps the whole conversion on your device.

My PDF has the wrong paper size. Why?

The page asks for the size with a CSS @page rule, which current versions of the main browsers follow. If yours ignores it, set the paper size in the print dialog to match the one you picked here.

Are tables and checkboxes supported?

Yes. GitHub Flavored Markdown tables, task list checkboxes, strikethrough and autolinked URLs all render, in addition to standard headings, lists, quotes, images and fenced code.

Can I use HTML inside my Markdown?

Raw HTML is shown as plain text rather than run, so a pasted file cannot inject scripts into the page. If you need HTML layout, convert with our Markdown to HTML tool and print from there.

Is my document uploaded?

No. Rendering and printing both happen in your browser. Close the tab and the draft is gone; nothing is stored on a server.

Related: Markdown to HTML, Markdown cheat sheet, HTML to PDF guide, PDF to Markdown.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

Product

Who It's For

Features

Resources

Company

View Sitemap