Mermaid Live Editor Online

Type Mermaid code in a mermaid block and watch the diagram redraw as you edit. Flowcharts, sequence diagrams, class diagrams, state machines, ER diagrams, Gantt charts and more — written inside a Markdown document, so the text around your diagrams renders too. Free, no sign-up, nothing uploaded.

Free · no sign-up · runs in your browser, nothing is uploaded

KaTeX display math and a Mermaid flowchart rendered inside the preview
KaTeX formulas and Mermaid flowcharts render right inside the document.

A Mermaid editor built into a Markdown editor

Mermaid turns a few lines of text into a diagram, which makes diagrams easy to diff, review and keep next to the documentation they explain. This page's editor is a split Markdown editor with Mermaid support built in: write the diagram where it belongs in the document, and the preview redraws it a moment after you stop typing. Diagrams you have not changed come back from a cache, so editing the prose around them stays fast; the engine itself loads the first time a document contains a diagram, which can take a moment.

Start with this block in the editor:

```mermaid
flowchart LR
  Idea --> Draft --> Review
  Review -->|changes| Draft
  Review -->|approved| Publish
```

and the flowchart appears on the right. Change LR (left to right) to TD (top down), add a node, or rename an edge, and the picture follows.

Diagram types you can draw

Every diagram below renders in the preview. Put the diagram keyword on the first line inside the fence:

Syntax for beta diagram types can change between Mermaid releases, so check the official Mermaid documentation for the exact keywords; this editor runs the version bundled with the site.

Debugging a diagram

When Mermaid cannot parse the code, the diagram block turns into an error box with the parser's message — the line number, the text it choked on and what it expected. Fix the line and the diagram replaces the error. Use the Split layout so you can see both at once; the preview scrolls with the line you are editing. Diagrams are rendered in Mermaid's strict security mode, so click callbacks and scripts inside diagram definitions are disabled, and inline HTML elsewhere in the document is sanitized.

Saving, sharing and exporting

The document autosaves in your browser. Export → Download .md gives you the Markdown file to commit next to your code. Share creates a link that contains the whole document, so a colleague opens it with the diagram already drawn. Download .html exports a standalone page with the diagrams as SVG, and Print / Save as PDF produces a PDF in which the diagrams stay sharp at any zoom. Diagram colours follow the light or dark theme you choose.

When to use this and when to use a dedicated tool

If you only want to iterate on one diagram with a configuration panel and image downloads, a dedicated tool such as mermaid.live is built for that. If the diagram belongs in a document — a README, a design note, an agent's plan, project documentation — a Markdown editor that renders Mermaid is the shorter path, because you see the diagram in context and can download the whole file. New to the syntax around it? See the Markdown cheat sheet, or open the Markdown editor directly.

See it in action

Markdown Viewer in split layout: Markdown source on the left, rendered GitHub-style preview on the right
Split layout — the source and the rendered preview side by side, scrolling in sync line by line.
The theme picker showing 16 light and dark themes with colour swatches
Sixteen themes, each with its own syntax palette — or follow the system light/dark setting.
The Export menu: download .md, download .html, print to PDF, copy as HTML, copy Markdown
Export as Markdown, a standalone HTML page or PDF, or copy the rendered HTML — shown in the Paper theme.

How it works

  1. 1
    Open the editor and type a fenced block that starts with ```mermaid, then your diagram code, then ```.
  2. 2
    The diagram appears in the preview and redraws as you type; a syntax error shows Mermaid's message instead.
  3. 3
    Keep it as a .md file, share the link, export a standalone HTML page, or print to PDF.

What you get

Live preview in split view

Source on the left, rendered diagrams on the right, redrawn shortly after you stop typing.

Mermaid v11, 20 diagram types

Flowchart, sequence, class, state, ER, Gantt, pie, journey, Git graph, mindmap, timeline and more.

Errors you can read

If the code does not parse, the preview shows the parser's message so you can find the line.

Diagrams and prose together

Headings, tables, code and math around the diagrams — the format GitHub READMEs use.

Light and dark

Diagram colours follow the active theme; pick from 16 themes.

Private

Mermaid runs in your browser. Your diagram code is never uploaded.

Frequently asked questions

How do I write a Mermaid diagram here?
Type or paste a fenced code block whose language is mermaid: three backticks, the word mermaid, a new line with your diagram code, and three backticks to close. The preview draws it. The editor does not accept bare Mermaid code without the fence.
Which Mermaid diagram types work?
Flowchart, sequence, class, state, entity-relationship, Gantt, pie, user journey, Git graph, mindmap, timeline, quadrant chart, requirement and C4 diagrams all render, as do the newer Sankey, XY chart, block, packet, kanban and architecture diagrams. The bundled engine is Mermaid 11.
Can I export the diagram as SVG or PNG?
There is no one-click SVG or PNG button. Export → Download .html saves a page with the diagrams embedded as SVG, Print / Save as PDF produces a PDF with vector diagrams, and Copy as HTML puts the rendered markup on your clipboard.
Is this the same as mermaid.live?
It uses the same Mermaid library, but it is a Markdown editor rather than a dedicated diagram tool: you write diagrams inside a document. There is no separate pan-and-zoom canvas or configuration panel for the diagram.
Why does my diagram show an error?
The preview prints the parse error from Mermaid, usually with the line and what it expected. Common causes are a missing diagram keyword on the first line, an unclosed bracket or quote, or a reserved word used as a node name.
Does it work with GitHub README diagrams?
Yes. GitHub also draws mermaid code blocks in Markdown, so you can draft the block here, check it, and paste it into your README. Rendering can differ slightly if GitHub bundles a different Mermaid version.
Do my diagrams leave my device?
No. The diagram code is rendered by Mermaid running in your browser and saved in its local storage. Share links carry the document inside the address itself, so treat anyone with the link as having the diagram code.

Related tools

Ready when you are

Paste Markdown, drop a file, or open a URL — the preview appears instantly and everything stays on your device.

Open Markdown Viewer