Markdown to PDF converter

Paste Markdown and check the print preview. Save as PDF gives you a document with real, selectable text and working links. Nothing is uploaded.

Free, no account needed. Updated .

Short answer

To convert Markdown to PDF, render the Markdown as HTML, style it for paper and print it to a PDF file. This converter does that in your browser: marked renders the Markdown, a print stylesheet sets the page size, margins and page breaks, and your browser saves the PDF with selectable text.

How to convert Markdown to PDF

  1. Paste your Markdown. Replace the sample text with your own. The print preview under the options updates as you type, up to 500,000 characters.
  2. Set the page. Choose A4 or US Letter, the margins, a sans serif or serif font and the text size. The document title becomes the PDF title and, in most browsers, the file name. Leave it empty to use the first # heading.
  3. Select Save as PDF. Your browser opens its print window with the document. Choose Save as PDF as the printer (on Windows, Microsoft Print to PDF also works) and save the file.

In the print window, open More settings and clear Headers and footers. Otherwise the browser prints the date, the page title and an address at the edge of every page.

Why this converter uses the print window

There are two common ways to make a PDF in a browser. One is a JavaScript PDF library that draws every line itself. The other is the browser's own print engine, the same one that prints any web page. This converter uses the print engine, for these reasons:

  • Real text. You can select, copy and search the text in the PDF, and screen readers can read it. Libraries that take a screenshot of the page and put it in the PDF lose all of that.
  • Working links. Links stay clickable in the PDF.
  • Correct layout. Tables, long words, lists inside lists and right-to-left text wrap the same way they do on screen. Libraries that place text line by line often break long table cells.
  • No large download. The page loads only the Markdown renderer. A PDF library with fonts adds much more code.

The cost is one extra click in the print window. If your browser blocks printing from this page, download the .html file, open it and print it from there: it holds the same document and print styles.

What the print stylesheet does

The Markdown is converted to HTML with marked (CommonMark plus GitHub-flavored Markdown) and cleaned with DOMPurify, the same steps as our Markdown to HTML converter. A print stylesheet then sets up the page:

Print stylesheet rules
PartWhat happens on paper
PageThe page size and margins you choose, set with the CSS @page rule.
HeadingsNever left alone at the bottom of a page: the next lines move with them.
ParagraphsAt least 3 lines stay together at the top and bottom of a page.
TablesFull width with borders. A row is not split across pages, and the header row repeats on each new page.
Code blocksA gray box in a monospace font. Long lines wrap instead of running off the page.
ImagesNever wider than the text column.
LinksUnderlined. Optional: the address printed after the link text, for readers on paper.

Colors are black and grays only. Many office printers print in grayscale, and a PDF that someone prints later should still be easy to read.

Example: a returns page

This Markdown is the sample in the tool:

markdown
# Returns and refunds

You can return an item within **30 days** of delivery.

## How to return an item

1. Sign in and open **Orders**.
2. Select the item and choose a reason.
3. Print the label and drop the parcel off.

| Item condition | Refund |
| --- | --- |
| Unopened | Full price |
| Opened, working | Full price minus shipping |

It prints as one A4 page: a large title, a smaller section heading, a numbered list and a table with a gray header row. The PDF title is "Returns and refunds", taken from the first heading.

Page breaks in long documents

Markdown has no page break mark. For a handbook or a manual with several chapters, select Start each # heading on a new page. Each top-level heading then starts a new page, except the first one. Use ## and ### for sections inside a chapter, so they stay on the same page as the text before them.

A table longer than one page continues on the next page with its header row repeated. A code block that fits on one page is kept whole. A longer one breaks where it must.

What it does not do

  • No relative images. An image such as images/logo.png points to a file next to your Markdown, and this page cannot see that file. Use a full https:// address.
  • No custom fonts. The PDF uses fonts that your computer already has. The same Markdown can look slightly different on Windows and on a Mac.
  • No page numbers from the converter. Browsers decide what goes in the page margins. Chrome and Edge add page numbers when Headers and footers is on, together with the date and address.
  • No extensions. Footnotes, math and Mermaid diagrams are not part of CommonMark or GitHub-flavored Markdown, so they print as text. Raw HTML is kept, except scripts, styles, forms and frames.
  • Print window settings win. If you change the paper size or the scale in the print window, the browser uses your choice there.

To build a table for your document, use the Markdown table generator. To go the other way and get the text out of a PDF, use PDF to text.

PDF guides are often where customers look for answers about returns, setup or billing. If you want a customer support chatbot that answers from those documents, Paperlink AI reads your uploaded PDFs and help pages and says when they do not hold the answer.

Frequently asked questions

Why does Markdown to PDF use the print window?

Your browser's print engine makes the PDF. It keeps the text selectable and searchable, keeps links clickable and draws fonts as vectors. JavaScript PDF libraries either place each line themselves, with weaker tables and wrapping, or put a picture of the page in the PDF.

How do I remove the date and address at the top of each PDF page?

In the print window, open More settings and clear Headers and footers. The browser adds them, not the converter, and most browsers remember the setting for the next PDF.

Can I add page breaks to a Markdown PDF?

Yes. Select Start each # heading on a new page, so each top-level section starts on its own page. A heading never ends a page alone, and table rows and code blocks stay on one page when they fit.

Do images in my Markdown show in the PDF?

Images with a full https address or a data address print. Images with a relative path, such as images/logo.png, cannot load here, because the file is not on this page. Replace them with full addresses first.

Does the Markdown to PDF converter work on a phone?

Mostly. On Android, choose Save as PDF as the printer. On iPhone and iPad, open the print options, then use Share and Save to Files. Page size and margin settings depend on the browser.

Is my Markdown uploaded to make the PDF?

No. The Markdown is converted and printed in your browser. It is not sent to our servers, and analytics record only that a PDF was made.

Newsletter

Support notes, once a month.

One email with what we learn about help centers, honest AI answers and support teams. Unsubscribe at any time.

We use your email only for this newsletter. See the Privacy Policy.