Skip to content
UniKit

Mermaid diagram renderer

Paste Mermaid DSL to parse it into a node/edge model and render SVG locally: flowcharts, class, ER and state diagrams use a node-link layout, sequence diagrams draw lifelines and messages, pie charts split by value — text-only types such as gantt return a model instead of a fake picture.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Mermaid DSL

Rendered output

Paste Mermaid DSL to see the rendered result

Parsed model

Nodes, edges, messages and pie slices are listed in input order; ignored lines (subgraph, style, comments …) are listed too.

Paste Mermaid DSL to see the rendered result

What this tool does

  • Need a diagram in a doc or PR description: paste the Mermaid DSL and get an SVG rendered locally, with no online rendering service involved.
  • Reviewing someone else’s diagram definition: the model lists every node, edge and label so missing branches are obvious.
  • Compare proportions with `pie`: feed labels and values, and get slices plus percentages.

Example

Input

flowchart TD
  A[Start] --> B{Check}
  B -->|yes| C(Process)
  B -- no --> D([End])

Output

type: flowchart
nodes: 4
  A [Start]
  B [Check]
  C [Process]
  D [End]
edges: 3
  A -> B
  B -> C (yes)
  B -> D (no)

Four nodes and three edges on a 389 × 118 canvas; `[ ]` is a rectangle, `{ }` a diamond, `( )` a rounded box and `([ ])` a stadium.

Frequently asked questions

Which types are actually drawn?

Flowchart/graph, classDiagram, erDiagram and stateDiagram(-v2) share the node-link layout (longest-path layering, rows stacked vertically, cycles converge); sequenceDiagram draws lifelines and message arrows; pie slices by value. gantt, journey, mindmap and gitGraph return a text model with drawn=false.

Why not use the official mermaid package?

mermaid is not a dependency of this site, and a function that imports a missing package and pretends to render would be dishonest — the previous version did exactly that, including a dead condition like `line.indexOf(char) === 0 || true`. This version parses the DSL itself and emits SVG: plain strings, assertable, identical output for identical input.

Which syntax works, and which lines are ignored?

Supported: node shapes `[ ] { } ( ) ([ ]) (( ))`, labelled links `-->|label|` and `-- label -->`, dotted `-.->`, thick `==>`, arrow-less `---`, class/ER relations `<|--` and `||--o{ ... : label`, and the state pseudo-state `[*]`. Ignored (and listed verbatim): subgraph, style, classDef, linkStyle, click, direction, note, plus class attribute lines such as `Dog : +bark()`.

Any limits?

The node cap is 200 by default (maxNodes can raise it to 2000); exceeding it raises an error instead of drawing an unreadable blob. Parsing and rendering happen entirely in the browser — nothing is uploaded and no external font or image is loaded.

Keywords:Mermaidflowchartsequence diagramsvg renderer

Related tools