Mermaid Diagram Editor

Write Mermaid flowcharts, sequence, class, state, Gantt and ER diagrams with a live preview, and export SVG or PNG.

Runs in your browser. Nothing is uploaded.

Preview

How to use the Mermaid Diagram Editor

  1. Type Mermaid code on the left, or pick a template such as Flowchart, Sequence, Gantt or Mind map.
  2. The preview updates as you type. Errors show the line number and what Mermaid expected.
  3. Download the diagram as SVG for documents and websites, or PNG for slides and chat.
  4. Use Copy as Markdown to paste the diagram into a GitHub or GitLab README, issue or wiki, where it renders automatically.

Diagrams from plain text

Drawing diagrams with a mouse is slow, and keeping them up to date is slower. Mermaid lets you write them instead: A --> B draws an arrow from A to B, and the layout is worked out for you. Change a line, and the whole diagram rearranges. This editor gives you a live preview while you type, starter templates for every common diagram, and exports for wherever the diagram needs to go.

Start from a template

The templates cover the diagrams people use most:

  • Flowchart for processes and decisions.
  • Sequence for how users, apps and services talk to each other.
  • Class and Entity relationship for code structure and databases.
  • State for status changes, such as an order or a document workflow.
  • Gantt for project plans with dates and dependencies.
  • Pie, Mind map, Timeline and Git graph for everything else.

Each template is a small, realistic example you can edit straight away.

Clear error messages

When Mermaid can’t read your code, the old preview fades and a message tells you the line with the problem and what was expected there. Fix the line and the preview comes back.

Export and share

Download SVG gives a sharp vector file that scales to any size, ideal for documentation sites and design tools. Download PNG renders at double resolution for slides, chat and email. Copy as Markdown wraps the code in a mermaid code block, which GitHub and GitLab draw automatically in READMEs, issues and pull requests. The preview follows the site’s light or dark theme, and so do the exports.

Private and offline

Mermaid runs entirely in your browser: nothing you draw is sent to a server. To turn a database schema into a diagram automatically, use the ER Diagram Generator.

Frequently asked questions

What is Mermaid?

Mermaid is a text language for diagrams. You describe boxes, arrows and steps in plain text and it draws the picture. Because the source is text, diagrams can live in Git next to your code and be reviewed like any other change.

Where can I use Mermaid diagrams?

GitHub, GitLab, Azure DevOps, Notion, Obsidian and many documentation tools render Mermaid code blocks directly. Elsewhere, export an SVG or PNG from this editor.

Which diagram types are supported?

All of Mermaid’s: flowcharts, sequence, class, state and entity relationship diagrams, Gantt charts, pie charts, mind maps, timelines, Git graphs, user journeys, quadrant and XY charts, Sankey diagrams, C4, kanban boards and more.

Why does the first preview take a moment?

The diagram renderer is a large library, so it is only downloaded when you first use the editor. After that, previews appear almost instantly and the page works offline.

Is my diagram uploaded?

No. Mermaid runs inside this page, so diagrams of private systems stay on your device.

Tutorials