FreeMD2PDF.com
English

Mermaid diagrams to PDF: typeset in your browser.

Write or paste Markdown with ```mermaid blocks and download a PDF in which every diagram is a sharp vector graphic with selectable text.

Source · .md Drop a .md file or images here
Proof A4 · page breaks follow the downloaded PDF Live
PDF engine on standby
About Free MD2PDF

Mermaid to PDF

Mermaid turns a few lines of text into flowcharts, sequence diagrams, Gantt charts and more. Getting those diagrams into a PDF is where it often goes wrong: many online Markdown converters do not render Mermaid at all and print the source code instead, some turn the whole page into one big image, and export from an editor may cut off wide diagrams or depend on fonts installed on your computer.

Here, every ```mermaid block is rendered to SVG in your browser and embedded in the PDF as native vector graphics. The diagram stays sharp at any zoom level, the labels can be selected, copied and found with search, and colours set with classDef or style come through as written.

How to convert Mermaid diagrams to PDF

  1. Add your diagrams. Paste your Markdown, or write a fenced code block with the language mermaid.
  2. Check the preview. Each diagram renders in the preview as you type; syntax errors are shown in place.
  3. Download the PDF. Press Download PDF. Diagrams are embedded as vector graphics next to the rest of your document.

Vector, selectable, never a screenshot

Because diagrams are embedded as vector paths and text rather than pixels, they print crisply at any size and keep the file small. Search in your PDF reader finds words inside the diagrams, and you can copy a label straight out of a flowchart.

Sized to the page

Diagrams keep their natural size when they fit. Wide ones are scaled down to the width of the text block instead of running past the margin, and one taller than a page is scaled to fit on a page. Labels are drawn as SVG text rather than embedded HTML, which is what makes some other exports show empty boxes where the labels should be.

All the common diagram types

Flowcharts, sequence diagrams, class diagrams, state diagrams, entity-relationship diagrams, Gantt charts, pie charts, mind maps, timelines and the other types Mermaid supports are rendered by Mermaid itself, so the syntax is exactly what you know from GitHub, GitLab, Obsidian or Notion.

Frequently asked questions

Why is my Mermaid diagram shown as code in the PDF?

The converter you used does not render Mermaid; it treats the block as ordinary code. Here, any fenced block marked mermaid is rendered as a diagram. If the syntax is invalid, the preview and the PDF show a box with Mermaid’s error message, the line number and the offending line, and the rest of the document still renders.

Is the diagram an image in the PDF?

It is a vector graphic, not a bitmap. It stays sharp when zoomed, and the text in it is real text that can be selected and searched.

Can I export only a diagram, without the rest of the document?

Yes: put just the ```mermaid block in the editor and download. The PDF then contains the diagram alone, at its natural size or scaled down to fit the page. To use a diagram elsewhere, hover it in the preview to copy its SVG or download it as SVG or PNG.

Do custom colours and styles survive?

Yes. Fills, stroke colours and line widths set with classDef, class or style are kept in the PDF.

Is my diagram uploaded to a rendering server?

No. Mermaid runs in your browser, and so does the PDF engine. The page is not allowed to send your document anywhere.

Guides and use cases

ChatGPT to PDF

save a ChatGPT answer as a clean PDF with its tables, code and formulas

DeepSeek to PDF

export DeepSeek answers, formulas included, as a PDF

Claude to PDF

turn Claude answers and Markdown artifacts, Mermaid diagrams included, into a PDF

Gemini to PDF

save Google Gemini responses as a typeset PDF

README to PDF

a GitHub README.md as a PDF, with tables, code and diagrams

CLAUDE.md to PDF

agent instruction files and Claude Code plans as a readable PDF

Print Markdown

print a .md file with proper page breaks, diagrams and fonts