Mermaid Online

SVG export · scalable vector output

Mermaid to SVG Converter

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

Paste or edit Mermaid code
Replace the sample below, or load another example.
Load example
Paste Mermaid code here. Preview and export load locally in your browser.
Live previewSample preview · Clean Docs

Write

Preview

Export

Docs Asset

Render & export

Export controls activate after your diagram renders locally.

Flowchart
Mode
Default renderNative MermaidOptimized exportStyled download
Export style
Clean DocsGitHub READMEGitHub DarkTransparent DocsWarm Editorial✦ ProWhiteboard Sketch✦ ProAurora Noir✦ ProBlueprint✦ ProChampagne✦ ProEmerald Suite✦ ProEditorial✦ Pro
Scale
1x2x4x
Or exact width, e.g. 1200px wide
Output: White · comfortable padding
Size: calculated after render
Filename: mermaid-flowchart-white-1x.svg

When SVG is better than PNG

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.

Static documentation sites

Use SVG when docs are built with frameworks that safely serve vector assets and benefit from resolution-independent diagrams.

Developer handoff

SVG is inspectable text, which makes it useful for design reviews, asset pipelines, and versioned documentation.

Vector workflows

Save SVG when you need to resize diagrams without blur or pass them into tools that understand vector graphics.

PNG, JPG, WebP, SVG or PDF: the same diagram in each format

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.

FormatFile size at 2xTransparent backgroundResizingBest for
PNG178 KBYesFixed pixels — pick 2x or 4xDocs, slides, README files, anywhere
JPG85 KBNo — filled whiteFixed pixelsUpload forms and tools that only take JPG
WebP38 KB (54 KB transparent)YesFixed pixelsWebsites and blogs where page weight matters
SVG147 KB, fonts embeddedYesSharp at any sizeDocs sites and pages viewed in a browser
PDF129 KBNo — white pagePage sized to the diagram; 2x or 4x image insideAttaching, printing, and sending for review

What is inside the exported SVG

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.

Where SVG works, and where to use PNG instead

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.

SVG export checklist

Need universal sharing?

Use PNG when the diagram must work everywhere, including email, issue trackers, and office tools.

Need editable markup?

Save SVG when you want a text-based vector file that can be inspected or transformed downstream.

Browser warns on SVG?

SVG is a text-based format, so some browsers or platforms treat downloads cautiously. Use HTTPS or export PNG as a fallback.

FAQ

Questions about this Mermaid export workflow

Is SVG the best format for Mermaid diagrams?+

It is best for scalable vector workflows, but PNG is safer for broad sharing. Use SVG when the destination accepts vector files.

Can I save SVG without uploading my Mermaid code?+

Yes. The Mermaid render and SVG export run in your browser for the core workflow.

Why might a browser warn about SVG downloads?+

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.

Should I use SVG for GitHub README files?+

PNG is usually safer for README compatibility. Use SVG when your publishing workflow explicitly supports it and you want scalable vector output.

How do I convert Mermaid to SVG online?+

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.

Why is the Mermaid SVG file larger than I expected?+

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.

Why are labels missing when I open the SVG in a design tool?+

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.