Markdown to PDF

How to use it

  1. Paste your Markdown into the box or press Open .md file. The preview on the right is drawn at the real page width, so lines wrap where they will in the PDF.
  2. Pick the paper size, margins, font and text size. Page numbers (“Page 3 of 8”) are on by default; you can also repeat the document’s first # heading at the top of every page after the first, and start each # heading on a new page.
  3. Press Save as PDF and choose Save as PDF in your browser’s print window. Leave margins at Default and turn off the browser’s own “Headers and footers”; the PDF takes its name from the first heading.

What it supports

GitHub-flavoured Markdown: headings, paragraphs, bold, italic and strikethrough, bulleted, numbered and nested lists, task lists with checkboxes, tables with column alignment, block quotes, inline code and fenced code blocks, links (including bare web addresses, which become links), images and horizontal rules. The text in the PDF is real text you can select and search, and links stay clickable.

Print layout fixes the usual problems of printing Markdown from a browser: headings are kept with the paragraph that follows them instead of being left alone at the bottom of a page, long lines in code blocks wrap instead of running off the page, table rows and list items are not split across pages where avoidable, and wide tables shrink their text to fit the column.

Raw HTML inside the Markdown is cleaned with DOMPurify before it is shown, so scripts, event handlers such as onerror and javascript: links are removed. Images referenced by web address are loaded from that address when the preview shows them; a picture saved on your computer cannot be reached from a web page, so embed it as a data URL or use an online copy.

What we tested

On October 15, 2026, in Chromium 141.0.7390.37, we opened a 2,470-word test document (four sections with subsections, nested and task lists, a 12-row table, a 300-character line of code, links, an embedded image and three script-injection attempts) and saved it as a PDF in four settings, 34 pages in all:

SettingPagesWords missingText outside marginsPage X of Y
Letter, 1 in margins800correct on every page
A4, 0.5 in margins600correct on every page
Letter landscape, 1.5 in margins1100correct on every page
Letter, new page per # heading900correct on every page

In every setting no heading was left as the last line of a page, the long code line wrapped onto four lines inside the margins, both links were clickable in the PDF and no javascript: link survived, and with “new page per # heading” all 4 sections started at the top of a page. None of the script-injection attempts ran. The page also worked on a 390-pixel phone screen. The preview runs in its own frame, so the headings of your document never mix with the headings of this page.

Tips

  1. Start the document with a # heading: it becomes the PDF’s file name and, if you choose, the running title.
  2. Use a horizontal rule (---) only for visual breaks; to force a new page, use the “new page per # heading” option.
  3. Very wide tables read better in landscape.
  4. Page numbers and the running title need Chrome or Edge 131 or later; other browsers print everything else the same way.

Frequently Asked Questions

How do I convert Markdown to PDF?+
Paste the Markdown or open the .md file, choose paper and margins, press Save as PDF and pick Save as PDF in the print window.
Are tables and code blocks supported?+
Yes: GitHub-style tables with alignment, fenced code blocks (long lines wrap instead of being cut off), inline code, task lists, block quotes, images and links.
Can I add page numbers?+
Yes, “Page X of Y” at the bottom of each page, in Chrome and Edge version 131 or later. You can also repeat the first heading as a title at the top of later pages.
Will links work in the PDF?+
Yes. Links stay clickable, and bare web addresses in the text become links too.
Is my file uploaded?+
No. The Markdown is converted and laid out in your browser. Only images that the Markdown points to by web address are fetched from those addresses.
Can I choose A4 instead of Letter?+
Yes: Letter, A4, Legal or A5, portrait or landscape, with narrow, normal or wide margins.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service