Mermaid Diagram Types

Mermaid draws many kinds of diagrams from plain text. Pick a type to open an editor that is already set up for it, with the syntax, examples and common errors below the editor. Everything renders in your browser and exports to PNG, SVG or PDF for free.

Which diagram type should I use?

Each page explains the syntax with a rendered example, so you can compare the types before you commit to one.

How Mermaid knows the diagram type

The first line of the code declares the type, and everything after it follows that type's syntax. Change the first line and the rest of the code has to change too. Comments starting with %% and a front matter block for configuration may come before it.

%% The first line declares the diagram type
sequenceDiagram
  Browser->>Server: GET /
  Server-->>Browser: 200 OK