1. Home
  2. Documents
  3. Markdown to PDF

Markdown to PDF

Save a Markdown document as a formatted PDF.

Runs in your browser · No upload
Preview (print layout)
Preparing…
Paper
Margins
Font size
When the print dialog opens, choose "Save as PDF" as the destination and save. Paper and margins are already set, so leave the dialog's margins on "Default". See below for mobile.

The preview and the print document contain only sanitized HTML (DOMPurify) and open in an isolated sandboxed frame where scripts and network requests are blocked. Images from external URLs are not loaded.

Your text is processed in this browser and never uploaded.

How to use

  1. Type Markdown on the left or drop a .md file. The preview on the right shows the page layout at paper width.
  2. Pick the paper (A4 or Letter), margins, font and font size, and turn on a table of contents, page breaks, a header or page numbers if you want them.
  3. Press Open print dialog, change the destination to Save as PDF and save. Paper size and margins are already set in the document, so leave the dialog’s margins on “Default”.

Options

Option Choices Notes
Paper A4, Letter Set as the @page size
Margins 15 · 20 · 25 mm The same on all four sides
Font Sans-serif, Serif, Monospace No web font is downloaded; the fonts installed on this computer are used
Font size 10 · 11 · 12 · 14 pt Headings scale with the body size
Wrap long code lines On (default) Off clips long lines at the page edge
New page before each # heading Off (default) Every # heading except one at the very top of the document starts a new page
Table of contents Off (default) Headings 1–3 on a page of their own, each a link to its place
Header title · page numbers Page numbers on Shown in Chrome and Edge only

Why print instead of generating the PDF directly

Browser printing draws the text with the fonts installed on your computer and saves it as PDF. That keeps Korean and other non-Latin text intact, makes the saved PDF’s text selectable, searchable and copyable, and leaves links clickable. The file is also much smaller than one made from screenshots of the text. The trade-off is that fonts differ from computer to computer. The sans-serif stack looks for Pretendard (if installed), Apple SD Gothic Neo, Malgun Gothic, Noto Sans CJK KR, then Segoe UI, Helvetica Neue and Arial.

Saving as PDF in each browser

  • Chrome and Edge: set the print dialog’s destination to “Save as PDF” and save. Under “More settings”, “Background graphics” brings out the shading of code blocks and table headers (this tool already asks the browser to keep colors).
  • Firefox: choose the “Save to PDF” destination (not Microsoft Print to PDF) and save.
  • Safari on Mac: use the “PDF” menu at the bottom left of the print dialog, then “Save as PDF”.
  • iPhone and iPad: the print preview there targets this whole page, so use Download printable HTML, open the file, then Share → Print and pinch the preview open to get a PDF you can save to Files.
  • Android Chrome: menu → Print → destination “Save as PDF”. If the dialog does not open, download the printable HTML, open it and do the same.

Good to know

  • The header title and page numbers use CSS @page margin boxes, which only Chrome-based browsers support today. Firefox and Safari simply leave them out and the body is unaffected. If you need page numbers there, save the PDF and add them with PDF Page Numbers.
  • Images from external URLs (https://…) are not loaded; only their alt text remains. Pictures embedded as data: URLs are printed.
  • Scripts, event attributes and unsafe links in the Markdown are removed during sanitizing, and the print document carries a content security policy that blocks scripts and network requests.
  • The browser’s “Headers and footers” option (date, address) is a browser setting; turn it off for a clean page.

To just check the rendering use Markdown Preview; to get a Word file use Markdown to Word; to join the resulting PDFs use Merge PDF and to shrink them use Compress PDF.

Your text is processed in your browser only and is never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.