Export your diagram
Export a finished diagram to use it outside Mermaid — in a document, presentation, report, or codebase.
Export formats
| Format | Best for |
|---|---|
| PNG | Presentations, documents, general sharing — easy to drop anywhere |
| SVG | Web embedding, print, high-resolution use — scales without losing quality |
| Reports, proposals, anything going to a stakeholder outside a browser | |
| MMD | Saving and sharing raw Mermaid syntax — useful for version control or reuse |
PNG export options
When exporting as PNG, you can set the background:
- Default background — uses the theme background color
- Transparent background — no background, useful for dropping the diagram onto a colored slide or page
- Custom background color — set a specific hex color
Choose the background before exporting under Export → PNG options.
SVG for web or print
SVG exports are vector-based: they scale to any size without losing quality. Use SVG when the diagram will appear in print materials, large-format displays, or embedded on a website.
To embed an SVG on a web page, you can also use a live SVG link rather than a static export — the link updates automatically when the diagram changes. Share your diagram →
PDF export
PDF exports are clean and formatted out of the box — no extra cleanup needed. Good for attaching to proposals, dropping into reports, or sending to stakeholders who don’t work in a browser.
MMD export
MMD saves the raw Mermaid syntax as a .mmd file. Use it to store diagrams in a repository, share syntax with a developer, or import into another Mermaid-compatible tool.
Common questions
-
The exported PNG looks pixelated. Switch to SVG for high-resolution use, or increase the scale setting under PNG export options if available.
-
My styles and theme aren’t showing in the export. Make sure the theme is set in the diagram’s front matter, not just in the editor settings — editor-level theme preferences don’t carry into exports.
-
The PDF has extra whitespace. This is usually a diagram size issue — try adjusting the diagram’s direction or breaking it into smaller sections before exporting.
What’s next?
- Send a live link instead of a file | Share your diagram →
- Turn diagrams into a presentation | Build a presentation →