🔒 Processed locally in your browser — no data uploaded
← Back to Home

Mermaid Diagram Editor

Mermaid Code
Preview

What the Mermaid Diagram Editor does

Mermaid Diagram Editor turns short text descriptions into diagrams. Write Mermaid syntax in the box, or start from one of five built-in templates, and the preview underneath redraws as you type. The result is a rendered picture rather than a set of editable shapes, which makes the page convenient for dropping a flowchart, sequence diagram or mind map into notes, tickets and documentation.

Rendering happens in the tab. The page loads the Mermaid library itself and passes your source to it directly, so the diagram is drawn as SVG inside the browser and the text never leaves the machine. The library file is the only thing fetched over the network, on first load; every redraw after that is local. When the source cannot be parsed, a short message replaces the diagram.

How to use it

  1. Load a starting templateThe dropdown above the preview inserts one of five examples: flowchart, sequence diagram, class diagram, mind map or Gantt chart. The box then holds editable code you can rename and extend.
  2. Edit the diagram as textChange node labels, arrow targets or the opening keyword that names the diagram type. The preview refreshes on every keystroke, so there is no render button to hunt for.
  3. Read the type from line oneMermaid decides the diagram type from the opening keyword: graph or flowchart, sequenceDiagram, classDiagram, mindmap, gantt. Leaving that first line out is the most common reason a diagram refuses to draw.
  4. Save the SVG or the codeThe preview is inline SVG, so right-click it to copy or save, and the vector stays sharp at any size. Keep the Mermaid source in your own file as well, since that is the version you can edit again later.

Options and formats

FlowchartStarts with a top-down graph: a start node, a decision branch, a success path and a debug path that loops back into the decision for another pass.
Sequence DiagramTwo participants exchanging messages plus a server call and its response, covering the request-then-reply shape that sequence syntax draws as vertical lifelines.
Class DiagramA base class with fields and a method, a subclass extending it, and an inheritance arrow between them. A workable starting point for data models.
Mind MapA root node branching into three groups with two leaves each, laid out around the centre. Renaming the labels is usually enough to turn it into a topic map.
Gantt ChartA dated project timeline with two sections, dependencies between tasks, and a date format line that every later date in the chart relies on.

Things to watch out for

Redraws wait for a pause in typingThe preview refreshes 250 milliseconds after your last keystroke rather than on every character, which keeps a long diagram responsive while you edit. Type and immediately look away and the picture can still be one edit behind.
The renderer is fetched from a CDN on first loadUntil that request finishes there is no drawing engine in the page, and the preview says so. On a slow or filtered connection the request can fail, leaving no diagram at all even though your source is perfectly valid.
One bad line removes the whole diagramRendering is all or nothing. A missing colon, an unclosed bracket or an unknown arrow type leaves an empty pane with a generic failure message and no line number to work from.
Only the template syntax is guaranteedFlowchart, sequence, class, mind map and Gantt all draw. Syntax added to Mermaid after version 10.9 may be rejected, and the error message never points at the offending line, so bisect a long diagram by pasting it in halves.

Frequently asked questions

What does the page send over the network?

One thing: the Mermaid library file, fetched from a CDN the first time you open the page. Your diagram source stays in the browser and is handed to that library in memory. If you reload while offline the renderer will not be there, and the preview will say so instead of drawing.

Which diagram types are supported?

The five templates cover flowchart, sequence, class, mind map and Gantt, and the bundled renderer handles anything else the Mermaid 10 syntax accepts — state, ER, user journey and pie charts among them. Features introduced in later Mermaid releases may not be recognised.

Why does the preview say it failed to render?

That message appears when the library refuses the source, which almost always means a syntax problem. Test something small such as a two-node graph: if that draws, the fault is in your diagram, and the usual culprits are a missing diagram-type keyword on line one, an unclosed bracket or an arrow type that does not exist.

Can I get an SVG out of it?

Yes. The preview is inline SVG rather than a raster picture, so copying or saving it keeps the vector quality at any size. Right-click the diagram to copy or save it, or read the markup out of the page source when you need to embed it in a document or a slide.

Can I share a diagram with a link?

Not conveniently. The page builds an encoded image URL internally but never writes it into the address bar and offers no copy button, so there is nothing to send. Paste the Mermaid code into your message instead; the recipient can render it there or paste it back here.

What is the fastest way to start?

Pick the template that matches the shape you need, edit the labels rather than typing from scratch, and leave the first line intact because it sets the diagram type. Renaming nodes is usually enough to get a usable picture within a couple of minutes.