esc
MMD → SVG

Mermaid to SVG:
Converter

Mermaid to SVG: paste or drop your diagram code and get a vector file that stays crisp when you zoom in.

Mermaid to PNG

How to convert Mermaid to SVG

  1. 01Drop your .mmd, .md or .txt fileA Markdown file works too: the first mermaid code block is read.
  2. 02Pick a themeDefault, Neutral, Forest or Dark. The diagram is drawn on your device.
  3. 03Save the .svgOne file per diagram, or a ZIP when you add several.
Violet file character juggling brackets

Vector output from plain text.

Mermaid lets you describe a chart in a few lines of text. This page turns those lines into an .svg file, the format docs sites, wikis and design tools handle best.

MMDDiagram as text
SVGVector · any size

SVG is the export you want when a diagram has to live inside documentation, a website or a design file. It is a vector format: lines, boxes and arrows are stored as shapes, not pixels, so a flowchart you place at full page width looks as clean as the same chart shown as a thumbnail.

Where an SVG diagram works well

  • Docs sites and wikis built with tools such as Docusaurus, MkDocs or Confluence, where a reader may zoom into a busy architecture chart.
  • A GitHub README, wiki or pull request. Commit the .svg next to your Markdown and link it as an image when you want the exact picture, not the version GitHub draws from code.
  • Figma, Inkscape and Illustrator, when a designer needs to restyle the boxes or move arrows before it goes into a slide deck or a report.
  • Web pages, where one small text file replaces several PNGs made for different screen sizes.
  • Print, because a vector diagram has no fixed resolution to run out of.

A quick worked example

Say your file login.mmd contains four lines: flowchart LR, then A[User] --> B{Password correct?}, then B -->|Yes| C[Dashboard], then B -->|No| A. Drop it on this page and the result is login.svg, a left-to-right chart with a diamond for the question and labelled arrows for the two answers.

If you keep diagrams inside Markdown notes, you don’t need to copy anything out. Drop the .md file and the converter finds the first fenced block marked mermaid. Put each diagram in its own file if a note has more than one.

Editing the result in a vector editor

Labels are written as SVG text rather than HTML boxes embedded in the picture. That choice matters later: Inkscape, Figma and Illustrator can select a label and let you retype it, change its font or recolor it.

Each node is a group of shapes, so you can move a box and its label together. Connectors are paths; after you move a box you may need to drag the arrow end by hand, since a vector editor doesn’t know Mermaid’s layout rules.

For big edits it is usually faster to change the Mermaid code and export again. Keep the .mmd file in your project so the diagram can be regenerated next time the process changes.

Themes and how they look in documents

Default gives purple-blue boxes, Forest uses greens, and Dark suits pages with a dark background. Neutral is grayscale, which prints well and fits formal reports. If the first line of your code sets a theme with an %%{init: …}%% directive, that setting wins over the menu.

Mermaid usually writes the SVG with a width of 100% and a max-width equal to the drawn size. On a web page the chart shrinks to fit a narrow column but doesn’t grow past its natural width. Set your own width in CSS if you want it larger.

Things to know before you share it

  • Click links and callbacks defined in the code are switched off: the converter runs Mermaid in strict security mode, so the SVG is a still picture.
  • Fonts are referenced by name rather than embedded. On a computer without the same font, labels appear in a similar fallback and may be a little wider or narrower.
  • A file that won’t convert usually has a syntax problem. The error names the spot where Mermaid stopped; check the first line names the diagram type and that labels with brackets are wrapped in quotes.

When PNG is the better pick

Some places accept only bitmap pictures: chat apps, many email clients and older office software. For those, use the Mermaid to PNG converter, which has a scale setting and a transparent background option. Keep the SVG as your master copy and make PNGs from the same code when you need them.

At a glance

Price
Free. No sign-up, no watermark.
Privacy
Files are processed in your browser and never uploaded.
Accepts
MMD, MERMAID, TXT, MD
You get
SVG
Batch
Convert many files at once and download them as a ZIP
Works in
Chrome, Edge, Firefox and Safari, on phones and computers
Offline
After the first conversion, it keeps working without internet

Questions

How do I export a Mermaid diagram as SVG?

Save the diagram code in a .mmd or .md file, drop it here, choose a theme and press Download. You get one .svg per file.

Is there a free Mermaid to SVG converter online?

This one is free, has no sign-up and adds no watermark. It also works offline once the page has loaded a conversion.

Is my diagram code sent anywhere?

No. The open-source Mermaid library runs inside your browser tab, so the code and the picture stay on your computer.

Which Mermaid diagram types can be saved as SVG?

Whatever the bundled Mermaid library can draw, including flowcharts, sequence, class, state, ER, Gantt, pie, user journey, mindmap and timeline diagrams.

Can I open the SVG in Figma?

Yes. Drag the file onto the Figma canvas or use Import. Boxes, arrows and text arrive as editable layers.

How do I put a Mermaid SVG in a GitHub README?

Commit the .svg to your repository, then add it with the usual Markdown image syntax and a relative path. GitHub shows SVG files as images.

Can I put the SVG into Google Docs or Word?

Word in Microsoft 365 inserts SVG pictures. Google Docs doesn’t accept SVG uploads, so make a PNG with the Mermaid to PNG converter for Docs.