Edit Mermaid diagrams with live SVG preview and export.
The Mermaid Playground turns Mermaid text into a diagram. Type or paste the source on the left, watch the preview update shortly after you stop typing, and download the result as SVG or PNG.
Mermaid is a text-based diagramming language. You describe a diagram in a short syntax and a JavaScript library draws it as SVG. It covers flowcharts, sequence diagrams, class diagrams, state diagrams, entity relationship diagrams, Gantt charts, pie charts and more. The first word or line of the source declares the diagram type, for example flowchart TD for a top-down flowchart, sequenceDiagram or erDiagram. Because the diagram is plain text, it can live in version control, be reviewed in a pull request and be changed with an ordinary edit instead of a drawing program. Many documentation systems and Git hosts render Mermaid blocks, but the supported syntax depends on the Mermaid version they bundle, so a diagram that works here can behave differently elsewhere. This playground uses Mermaid in strict security mode with HTML labels turned off, which affects what label markup is allowed.
No. Mermaid is loaded on demand and runs in the page. The source is not sent to a server by this tool.
They replace the source with a starter example: Flowchart, Sequence, ER or Class. They overwrite whatever is in the box, so copy your own text first.
Yes, with Download PNG. It is rendered at 2x scale on a white background with each side capped at 8000 pixels. Download SVG gives a vector file.
Mermaid syntax and rendering change between versions, and other sites may use different security and label settings. This playground uses strict security with HTML labels off.
The project depends on Mermaid 12.x (^12.3.0). The exact installed patch version is not shown in the tool.
The generated SVG is passed through DOMPurify with its SVG profile before it is shown or downloaded, which removes scripts and event handlers.