Static documentation sites
Use SVG when docs are built with frameworks that safely serve vector assets and benefit from resolution-independent diagrams.
SVG export · scalable vector output
Save Mermaid diagrams as scalable SVG files for static documentation sites, design handoff, vector editing, and code-based publishing workflows. Use SVG when you need crisp resizing or want to inspect the markup.
No signup · No watermark · Save SVG · Local browser rendering · Scalable vector output
Export controls activate after your diagram renders locally.
SVG is ideal when the diagram needs to remain sharp at any size, fit into a static site pipeline, or pass through a vector-aware workflow. It is less universal than PNG, so keep a raster fallback for platforms that block SVG uploads.
Use SVG when docs are built with frameworks that safely serve vector assets and benefit from resolution-independent diagrams.
SVG is inspectable text, which makes it useful for design reviews, asset pipelines, and versioned documentation.
Save SVG when you need to resize diagrams without blur or pass them into tools that understand vector graphics.
One 16-line flowchart, exported from this editor in the Clean Docs style on a white background at 2x. Sizes change with the diagram, but the ratios between formats hold. Every format is free and has no watermark; the Mermaid to image converter exports all five from one preview.
| Format | File size at 2x | Transparent background | Resizing | Best for |
|---|---|---|---|---|
| PNG | 178 KB | Yes | Fixed pixels — pick 2x or 4x | Docs, slides, README files, anywhere |
| JPG | 85 KB | No — filled white | Fixed pixels | Upload forms and tools that only take JPG |
| WebP | 38 KB (54 KB transparent) | Yes | Fixed pixels | Websites and blogs where page weight matters |
| SVG | 147 KB, fonts embedded | Yes | Sharp at any size | Docs sites and pages viewed in a browser |
| 129 KB | No — white page | Page sized to the diagram; 2x or 4x image inside | Attaching, printing, and sending for review |
The SVG is the diagram exactly as Mermaid draws it: shapes and connectors as vector paths, and labels as HTML inside foreignObject elements — the flowchart in the table above has 15 of them. The export also embeds the fonts the style uses, which is why the file is 147 KB rather than a few kilobytes: the labels look the same on a machine that does not have those fonts installed.
Browsers draw this SVG, including inside an <img> tag — this editor turns the same file into PNG that way. Some vector editors do not draw foreignObject content, so check the labels after importing the file into one; for a document or slide, a 4x PNG avoids the question.
SVG suits pages read in a browser: static documentation sites, wikis that accept image uploads, and blog posts. It stays sharp at any zoom level, so one file serves every screen size. SVG vs PNG goes through the trade-offs in detail.
Some destinations take PNG more reliably than SVG. Google Docs does not accept SVG uploads, so the Google Docs guide uses PNG; for a GitHub README, a Mermaid code block renders natively and needs no export at all.
Use PNG when the diagram must work everywhere, including email, issue trackers, and office tools.
Save SVG when you want a text-based vector file that can be inspected or transformed downstream.
SVG is a text-based format, so some browsers or platforms treat downloads cautiously. Use HTTPS or export PNG as a fallback.
FAQ
It is best for scalable vector workflows, but PNG is safer for broad sharing. Use SVG when the destination accepts vector files.
Yes. The Mermaid render and SVG export run in your browser for the core workflow.
SVG is text/XML and can contain active content in some contexts. This tool renders with strict Mermaid settings, but some local or insecure environments still show cautious browser messaging.
PNG is usually safer for README compatibility. Use SVG when your publishing workflow explicitly supports it and you want scalable vector output.
Paste the Mermaid code into the converter on this page and click Save SVG. The diagram is rendered and saved in your browser, with no signup, no watermark and no upload.
The export embeds the fonts used by the style so labels render the same on any machine. A 16-line flowchart comes to about 147 KB; most of that is font data, not the diagram.
Mermaid writes labels as HTML inside foreignObject elements. Browsers draw them, but some vector editors skip foreignObject content. Open the SVG in a browser to check it, or export a 4x PNG for tools that drop the labels.