Mermaid to SVG Converter
SVG keeps your diagram as vector graphics, so it stays sharp at any size and the text remains selectable. Paste Mermaid code, check the preview and download the SVG.
Try it
Edit the code; the preview updates as you type.
Rendering diagram…
Free Mermaid to SVG export, no watermark
It is the best format for websites, documentation sites and design tools such as Figma or Illustrator, where you may want to restyle the diagram later.
How to convert Mermaid to SVG
- Paste your Mermaid code into the playground above, or edit the example. The preview updates as you type.
- Check the preview. If the code has a syntax error, the message names the line that failed.
- Click SVG in the playground to download the file. For an SVG without a background color, choose Open in editor and tick Transparent background in the Export menu.
- The file downloads straight from your browser. Your code is not uploaded anywhere.
Example Mermaid code
The playground above starts with this diagram. Replace it with your own code, or paste it into any tool that renders Mermaid.
sequenceDiagram
participant B as Browser
participant M as Mermaid
B->>M: Render code
M-->>B: SVG markup
B->>B: Download .svg fileSVG export options
| Option | What it does |
|---|---|
Background | By default the SVG gets the same background as the preview, so it looks identical. |
Transparent background | Leaves the background out so the page behind the diagram shows through. |
Diagram theme | Colors and fonts come from the diagram theme selected in the preview. |
When to choose SVG
- Websites and static documentation
- Figma, Illustrator and Inkscape
- Large posters and print that must stay sharp
- Embedding in HTML without a Mermaid script
| Format | Best for |
|---|---|
PNG | Slides, documents, chat and email; up to 4x for sharp text |
SVG | Websites, design tools and large prints; scales without blur |
PDF | Printing, attachments and reports; page sized to the diagram |
Tips for a better SVG
- An SVG is text, so it is usually smaller than a high-resolution PNG and compresses well.
- Some tools, such as older Word versions and many chat apps, do not display SVG. Use PNG for those.
- The exported file uses system fonts. If exact typography matters, convert the text to outlines in a design tool.
- To use the diagram on a page in both light and dark mode, export with a transparent background and pick the default diagram theme in light mode.
Frequently asked questions
Is the SVG export free?
Yes. SVG export is free, needs no account and adds no watermark.
Can I edit the exported SVG?
Yes. Open it in Figma, Illustrator, Inkscape or a text editor to change colors, text or layout.
Should I use SVG or PNG?
Use SVG for websites and anything that needs to scale. Use PNG for slides, documents and apps that do not support SVG.
Why does my SVG look different in another app?
Apps substitute fonts they do not have, which can change text width. PNG avoids this because the text is already rendered into pixels.