Mermaid Diagram Editor (Live Preview)

Developer Tools

Write Mermaid code and see the diagram render as you type, then export it as SVG or PNG.

Mermaid code7 lines
Diagramlive preview
Rendered diagram

Paste a ```mermaid block into GitHub, GitLab, Notion or Obsidian Markdown and it renders there too.

Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy

About

What the Mermaid Diagram Editor does

The Mermaid Diagram Editor renders Mermaid code as you type: flowcharts, sequence diagrams, class diagrams, entity relationship diagrams, Gantt charts, state diagrams and pie charts. Start from a template, pick a theme, and export the diagram as SVG or a high-resolution PNG, or copy it as a Markdown code block for GitHub, GitLab, Notion or Obsidian. Syntax errors show their line number.

Steps

How to use it

  1. 1Pick a template or paste Mermaid code.
  2. 2Edit the code; the diagram updates as you type.
  3. 3Export SVG or PNG, copy a Markdown block, or share a link.

Example

A real run

Input

flowchart TD
  A[Visitor lands on pricing] --> B{Has an account?}
  B -- Yes --> C[Sign in]
  B -- No --> D[Start free trial]
  D --> E[Verify email]
  C --> F[Dashboard]
  E --> F

Output

Rendered flowchart: 6 nodes, 6 arrows, a 360 × 610 SVG

Visitor lands on pricing → Has an account? → Yes: Sign in → Dashboard; No: Start free trial → Verify email → Dashboard

Export: diagram.svg, or diagram.png at 2× (720 × 1220)

The diamond is a decision with two labelled branches; both paths end at the same Dashboard node, and Mermaid lays the chart out top to bottom.

Options

Every setting, and when to use it

Templates
Starting points for a flowchart, sequence, class, entity relationship, Gantt, state and pie diagram, each a small realistic example to edit rather than a blank page.
Themes
default, neutral, forest, dark and base change colors and fonts. Neutral prints well in documents; dark suits slides on dark backgrounds.
Export and share
SVG stays sharp at any size and is editable in design tools; PNG (2×) is ready for slides and documents. Copy as Markdown wraps the code in a ```mermaid block. Share link puts the code in the link itself, after the # sign.

Good to know

Common problems and limits

Source up to 50 KB. Mermaid runs in strict security mode and the diagram is shown only as an image, so text inside it cannot run scripts.

Labels are drawn as plain SVG text so exports work everywhere; HTML inside labels, such as <b>, is shown as text.

For network and dependency graphs with automatic layout options, try the Graphviz Online Viewer; to render a whole Markdown document, use Markdown to HTML.

Audience

Who uses it

  • DevelopersDraw architecture, request flows and database relationships for READMEs, pull requests and design docs.
  • Product managers and analystsSketch user flows, process maps and project timelines as text that is easy to update.
  • Technical writersKeep diagrams in documentation as code, versioned alongside the text, and export images where Markdown is not rendered.

FAQ

Frequently asked

What is Mermaid?

An open-source language for describing diagrams in plain text: you write the nodes and arrows, and Mermaid lays them out and draws them. Because diagrams are text, they live in version control and change in a code review like any other file.

Can I use Mermaid diagrams in GitHub and Notion?

Yes. GitHub, GitLab and Obsidian render a ```mermaid code block in Markdown as a diagram, and Notion renders Mermaid inside code blocks set to Mermaid. Copy as Markdown gives you the block, ready to paste.

Mermaid, Graphviz or PlantUML: which should I use?

Mermaid is the easiest to start and renders natively on GitHub and in many docs tools. Graphviz gives more control over layout for large networks and dependency graphs. PlantUML covers the most UML diagram types but usually needs a Java server to render.

How do I export a high-resolution PNG?

Press PNG (2×) for an image at twice the diagram's size, sharp on retina screens and in slides. For print or very large posters, export SVG, which scales to any size without blurring.

Why does my diagram show a syntax error?

Common causes are a missing arrow, a label with parentheses or quotes that needs wrapping in quotes, or a keyword typo in the first line, such as flowchart TD or sequenceDiagram. The error shows the line number.

Is my diagram code sent anywhere?

No. Diagrams are rendered in your browser. A copy of the code is saved to your past runs when you export or copy it.

Automation: an MCP tool render_mermaid(code, format) → file and an n8n node are planned (the diff output is text).

GuideDiagrams as code: Mermaid vs Graphviz →Mermaid or Graphviz? Mermaid renders in GitHub and Notion Markdown; Graphviz lays out large generated graphs. Syntax, layouts and when to pick each.
Built and maintained by Radhika SinghLast updated Questions: hello@operativez.ai