How to convert Mermaid to PDF
- Paste your Mermaid code above.
- Choose a theme and background.
- Click Download PDF. The page is sized to the diagram with a small margin.
When to use PDF
PDF is perfect for specs, architecture reviews, printed handouts and attaching diagrams to formal documents. Because the export is vector-based, it prints crisply at any size and the text remains selectable.
Good to know
- The PDF is generated locally in your browser using vector drawing — no screenshots.
- Very wide diagrams produce a landscape page automatically.
- To combine several diagrams in one document, export each and merge them, or paste PNGs into your doc tool.
- Prefer an image? Try Mermaid to PNG or Mermaid to SVG.
Frequently asked questions
Is the PDF vector or raster?
Vector. Shapes and text are drawn as PDF paths and text, so they stay sharp at any zoom level.
What page size is used?
The page is sized to fit the diagram plus a small margin, in portrait or landscape automatically.
Do I need an account?
No. The converter is free and runs entirely in your browser.
More free tools
- Mermaid to PNG — Convert Mermaid code to a high-resolution PNG image online.
- Mermaid to SVG — Convert Mermaid diagrams to clean, scalable SVG files online.
- Markdown Mermaid Viewer — Paste Markdown (README, docs, notes) and preview every ```mermaid code block as a rendered diagram.
- AI diagram generator — create Mermaid diagrams from text.