Markdown to a paged, printable PDF
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Opens
MDMARKDOWNTXT- Saves as
PDFHTML- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Batch processing
- One file at a time
- Offline use
- Works without a connection once this page has loaded
- Built with
- Marked and DOMPurify
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About Markdown to PDF
Markdown to PDF turns Markdown text into a print-ready PDF whose text you can select, search and copy. Type or paste Markdown, or open a .md file, and the preview lays the document out at the width of the paper you pick (A4, Letter or A5), with dashed lines where pages are expected to break. Headings, tables, task lists, fenced code blocks, block quotes and images from web addresses or data URIs are rendered, and a line containing only \pagebreak starts a new page.
The PDF comes from your browser's own print engine: Generate PDF opens the print dialog with the formatted document, and you choose Save as PDF as the destination. Because the browser draws the text with your installed fonts, Chinese, Japanese, Korean and other scripts stay real text instead of pictures. You can set narrow, standard or wide margins, a simple, academic or GitHub-like style, three font sizes and page numbers in the footer. Your Markdown is converted by the marked library and cleaned with DOMPurify inside the page, so the file is never uploaded.
Markdown to PDF runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use Markdown to PDF
- Type or paste Markdown into the Markdown box, or drop a .md, .markdown or .txt file on it.
- In Options, pick the paper size, margins, style and font size, and switch Page numbers on or off.
- Check the preview: the dashed lines mark the approximate page breaks. Put \pagebreak on its own line wherever you want a new page.
- Click Generate PDF, set the destination to Save as PDF in the print dialog, and save the file.
- If you need a web page instead, click Download HTML to get a standalone .html file with the same layout.
Frequently asked questions
Why does a print dialog open instead of a download?
Printing to PDF is the only way a web page can produce a PDF in which every script, including Chinese, Japanese and Korean, is real text drawn with proper fonts: selectable, searchable and sharp at any zoom. Drawing the pages as images would allow a direct download, but the text could not be copied or searched. In the dialog, set Destination (or Printer) to Save as PDF; on Windows, Microsoft Print to PDF works too. The first heading of your document, or the file name if there is no heading, is suggested as the PDF file name.
Why are there no page numbers in my PDF?
Page numbers are added with CSS page margin boxes, printed as "page / total" at the bottom centre of each page. Chrome and Edge support them from version 131. Firefox and Safari did not support them when this tool was written, so their PDFs come out without numbers; their print dialogs have a Headers and footers option that adds the browser's own page numbers along with the date and web address. In Chrome, leave Headers and footers unticked so you do not get two sets of numbers.
Why does my image show as a dashed box?
Only images with a full web address (https://…) or embedded as a data URI can be shown. A relative path such as ./img/chart.png cannot be resolved, because the browser only receives the text of your file, not the folder around it, so the tool shows a placeholder with the image's alt text instead. Use the image's full URL or embed it as a data URI. Images from web addresses are fetched from their server when the preview and the PDF are made.
How exact are the page breaks in the preview?
The preview lays the document out at the paper width with your margins and estimates where pages end: table rows, code blocks, images and headings are kept whole, and a heading moves to the next page together with the block after it. The print engine makes the final decision, so a break can land a line or two away from the dashed line. To force a break, write \pagebreak alone on a line; inside a fenced code block it stays ordinary text.
Which Markdown syntax is supported?
GitHub Flavored Markdown: headings, bold, italic, strikethrough, links, ordered and bulleted lists, task lists, tables with column alignment, fenced code blocks, block quotes and horizontal rules. Code is set in a monospace font without syntax colouring, and long code lines wrap instead of being cut off at the page edge. Raw HTML is allowed but sanitized with DOMPurify, which removes scripts and event handlers. Footnotes, math formulas and diagrams are not supported.