Markdown to PDF

Write or paste Markdown, check the GitHub-style preview, and save it as a PDF with tables, code and Mermaid diagrams intact.

Source

In the print dialog, choose “Save as PDF” as the destination.

How to use

  1. Type or paste Markdown into the editor, press Open file to load a .md file (up to 5 MB), or drop the file onto the editor.
  2. Check the result on the Preview tab; on a narrow screen, switch between Edit and Preview.
  3. Press Download PDF, choose “Save as PDF” as the destination in the print dialog and save the file.

About this tool

What you can write

The editor understands GitHub-flavoured Markdown: headings, bold and italic, ~~strikethrough~~, tables, task lists (- [ ] and - [x]), links and bare URLs that turn into links on their own. GitHub's alert blocks work too: start a quote with > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] and it gets the matching colour and icon. Fenced code blocks with a language name, such as js or python, get syntax highlighting, and raw HTML inside the Markdown is rendered as well.

Diagrams with Mermaid

Write a fenced code block whose language is mermaid and the preview draws it as a diagram:

flowchart LR
  Draft --> Review --> Publish

Flowcharts, sequence diagrams, Gantt charts and the other Mermaid diagram types are supported. Diagrams go into the PDF as vector graphics, so they stay sharp when you zoom in or print.

Getting a clean PDF

Download PDF opens your browser's print dialog for the preview only, not the editor. Choose “Save as PDF” as the destination. In Chrome and Edge, open “More settings” to pick the paper size (A4 or Letter) and margins, and tick “Background graphics”, otherwise the shading behind code blocks and alerts is left out. The file is named after the first heading, so give your document a clear # title.

Privacy

Everything happens in your browser. Your draft is kept in this browser's local storage so it is still there when you come back, and nothing is uploaded. Press Clear to empty the editor.

Common mistakes

  • A fenced block without the word mermaid after the backticks shows up as plain code, not a diagram.
  • Leave a blank line before a table. Directly under a line of text, the table can be read as part of that paragraph.
  • A table needs the separator row (| --- | --- |) under its header row.
  • Task-list boxes need a space inside: [ ], not [].

Frequently asked questions

How do I convert a Markdown file to PDF?

Open the .md file or paste its text into the editor, press Download PDF, and choose Save as PDF in the browser's print dialog. Only the preview is printed, not the editor.

Can I include Mermaid diagrams in the PDF?

Yes. Put the diagram in a fenced code block whose language is mermaid. Flowcharts, sequence diagrams, Gantt charts and other Mermaid types are drawn in the preview and saved in the PDF as sharp vector graphics.

Why is the background of my code blocks missing in the PDF?

Browsers skip background colours when printing by default. In the print dialog, open More settings and tick Background graphics (Print backgrounds in Firefox).

What is the PDF file called?

The file is named after the first heading in your document. Add a # heading at the top to give the PDF a meaningful name.

Is my Markdown uploaded anywhere?

No. The preview and the PDF are made in your browser. Your draft is saved only in this browser's local storage, and Clear removes it from the editor.