Markdown to PDF

Drop a Markdown file here, or click to choose one The file is read in your browser. It is never uploaded.

No file selected.

Export PDF

About this tool

Convert Markdown into an A4 PDF. Paste text or load a .md, .markdown or .txt file, check the rendered preview, then export it either as selectable text or as page images.

How to use

  1. Paste Markdown into the editor, or drop a file onto the drop zone.
  2. Review the preview.
  3. Choose Text or Image output.
  4. Click Download PDF.

Text mode vs image mode

  • Text — jsPDF lays out the rendered HTML itself, so the result is selectable and searchable. It uses the font jsPDF ships with, which covers Latin text; Chinese, Japanese and Korean need a font that is not bundled here.
  • Image — html2canvas rasterises the page at twice the CSS size, then cuts the canvas into A4-sized slices. This reproduces any script the browser can draw, but the text cannot be selected and an element may be split across a page boundary.

What this page loads over the network

This is the one tool on the site that is not self-contained. Four libraries are loaded from cdn.jsdelivr.net:

  • marked — turns Markdown into HTML;
  • DOMPurify — sanitises that HTML before it is inserted;
  • html2canvas — image mode;
  • jsPDF — writes the PDF.

If the CDN is unreachable, the preview says the libraries failed to load and export does not work. The Markdown itself, the rendered DOM and the finished PDF are never uploaded — the processing stays in the browser.

Limits

  • Remote images may be missing: html2canvas needs CORS permission, and relative paths inside an uploaded file cannot be resolved.
  • Image-mode pagination cuts the canvas at a fixed height, so it does not respect element boundaries.
  • Preview and PDF share one DOM builder and one set of styles, but image mode lays the document out at a fixed width off-screen, so the PDF is close to the preview rather than pixel-identical.
  • Rasterising a long document at 2× uses a lot of memory; very large inputs can fail in the browser rather than produce a partial file.

FAQ

Are my Markdown files uploaded?

No. They are read with the File API and converted in the page. The libraries come from a CDN, which is a separate request — see the note above.

Why are some images missing from the PDF?

Either the image refuses cross-origin rendering, or its path is relative and cannot be resolved from the uploaded file. Absolute, CORS-enabled URLs work best.

Can I export a long document?

Yes, the output spans multiple A4 pages. Image mode may split an element across the break.

Why is my Chinese text missing in text mode?

The bundled font only covers Latin. Use image mode, or export with a tool that embeds a CJK font.