Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Mermaid

Markdown-like syntax for creating flowcharts, diagrams, and visualizations programmatically.

Charts and data visualisationNPM

GitHubWebsite

1. License

License from npm.

github.com/mermaid-js/mermaid

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Mermaid does

Mermaid turns a few lines of Markdown-like text into a diagram, so diagrams can live in the repo next to the code and be diffed and reviewed instead of redrawn; the README pitches this as a fix for documentation that goes stale.

Mermaid popularity

81 / 100
Gid Score, #77 overall
28.7M
downloads a week, npm
91.2K
GitHub stars
74
agent projects use it
Mermaid: downloads per weeknpm, mermaid 28,707,819
Mermaid: GitHub starsmermaid-js/mermaid 91,220

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Mermaid is used

  • Mermaid is a dependency in 74 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.5% of the 4,867 JavaScript/TypeScript ones), #4 of 95 in charts and data visualisation.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 196; those are left out of every share on this page.
  • The most used alternative in our scan is Recharts (576 projects).
  • Projects that use it most often also use remark-gfm (40.5%), jsdom (39.2%), React (68.9%).

By coding agent

52 projects, 1.6%
40 projects, 1.3%
18 projects, 0.7%
16 projects, 3.4%
11 projects, 3.2%
9 projects, 1.9%

Often used with

In 40.5% of its projects
In 39.2% of its projects
In 68.9% of its projects
In 35.1% of its projects
In 36.5% of its projects
In 50.0% of its projects
In 32.4% of its projects
In 47.3% of its projects

Mermaid in practice

Strengths

Diagrams diff like code

A Mermaid diagram is just text, so it goes through the same pull-request review as the code it describes. The README says diffs and reviews "just work".

GitHub renders it without a build step

The README says Mermaid code blocks render directly in Markdown on GitHub. A diagram in a README or docs file shows up as a picture with no extra tooling.

One syntax family, many chart kinds

The README lists flowchart, sequence, class, state, ER, Gantt, pie, Git graph, mindmap, timeline and Sankey, and says there are more than 20 types in total.

Language models write it well

Miro's product manager for its Mermaid feature writes that Mermaid "has taken on a new life" because LLMs are good at producing it. She also says agents can make targeted edits to a text diagram instead of regenerating it.

Watch out for

Lowercase <code>end</code> breaks flowcharts

The docs warn that <code>end</code> in all lowercase as a node ID or label breaks the flowchart parser. Use <code>End</code>, <code>END</code> or another word.

Edge labels starting with o or x misparse

A label like <code>--&gt;|ok|</code> is read as a circle or cross edge. The docs say to add a leading space or capitalize it. Labels with commas, semicolons or parentheses also need quotes.

Minor releases can move your layout

A recent minor release added <code>elk.orientFeedbackEdges</code>, enabled by default, which changes how some existing ELK diagrams are routed. To keep the old routing you have to set the option to <code>false</code>.

A flowchart from the README

flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]

More about Mermaid

Funding
  • GitHub Sponsors: https://github.com/knsv
  • GitHub Sponsors: https://github.com/sidharthv96
  • 3 GitHub sponsors

See all

Agent Skills for it
  • mermaid-diagram: Generate Mermaid diagrams from user requirements. Supports flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, and 18
  • mermaid-to-proverif: Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files). Use when genera
  • mermaid-studio: Expert Mermaid diagram creation, validation, and rendering with dual-engine output (SVG/PNG/ASCII). Supports all 20+ diagram types including
  • mermaid-visualizer: Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, cre
  • mermaid-visualizer: Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, cre
  • mermaid-syntax: Mermaid syntax reference for writing or fixing a diagram in an artefact: flowchart, sequence, class, state, ER, Gantt, C4, mindmap, timeline

See all

Packages around it
  • react: UI library
  • remark-gfm: GitHub-flavored Markdown for remark
  • clsx: className string helper
  • typescript: Typed JavaScript
  • tailwindcss: Utility-first CSS
  • class-variance-authority: Component style variants
More in Charts and data visualisation

Alternatives

Mermaid This page

MITGid 8128.7M/wk

Recharts

Composable React component library for building responsive charts.

MITGid 8571.4M/wk

D3.js

JavaScript library for creating data-driven documents with powerful data visualization capabilities.

ISCGid 8136M/wk

Compare Mermaid with another tool

Get started

Install it.

npm install mermaid

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Mermaid
- Start every diagram with its type declaration, for example `flowchart LR` or `sequenceDiagram`.
- Never use lowercase `end` as a flowchart node ID or label; write `End` or `END`.
- If an edge label starts with `o` or `x`, add a leading space or capitalize it (`-->| ok|` or `-->|Ok|`) so it is not read as a circle or cross edge.
- Wrap node labels that contain parentheses, commas or semicolons in quotes: `A["This label has (parentheses)"]`.
- Define a node's label once and reference it by ID everywhere else.
- When upgrading, check the release notes for layout changes: with ELK, set `elk.orientFeedbackEdges: false` to keep the previous routing.