Back to directory

Data & Analytics · Business Intelligence & Reporting

Mermaid

Text based diagrams for documentation, code review, and automation

Mermaid is a JavaScript and TypeScript diagramming tool that turns Markdown inspired text into flowcharts, sequence diagrams, architecture views, and other visualizations. It suits developers, technical writers, and teams keeping diagrams beside source code. The core project is MIT licensed, while Mermaid Chart offers a hosted service with a free tier and paid plans from $10 per user monthly when billed annually.

Key facts

License
MIT
Main language
TypeScript, JavaScript, CSS, HTML
Maintainer
Mermaid community, Mermaid Chart, and Open Core Ventures
First released
2014
Latest release
mermaid@12.2.0, October 13, 2026
GitHub stars
90.8k, October 2026
Hosted option
Mermaid Chart Basic free, Plus $10 per user monthly annually, Premium $20 per user monthly annually, Enterprise custom

What Mermaid is

Mermaid began in 2014, created by Knut Sveidqvist to make documentation easier to maintain through diagrams defined in Markdown inspired text. Its first npm releases appeared in December 2014, beginning with version 0.2.11. The project is maintained by the Mermaid community, with the repository identifying Mermaid Chart and Open Core Ventures as backers, while contributors include Sidharth V, Knut Sveidqvist, Ashish Jain, Alois Klink, and others. Adoption is reflected in more than 90,000 GitHub stars, over 11 million weekly npm downloads, and more than 2,100 dependent packages recorded for version 12.2.0. GitHub renders Mermaid code blocks natively, and the project supports documentation, repositories, production scripts, and browser applications. Mermaid remains MIT licensed, while Mermaid Chart offers separate hosted plans, including a free Basic tier, paid Plus and Premium tiers, and custom Enterprise pricing.

How it works

Mermaid turns Markdown inspired text into diagrams that remain editable, diffable, and suitable for documentation, code review, and automated builds. Its dedicated grammars cover flowcharts, sequence, class, state, entity relationship, Gantt, pie, Git graph, mindmap, timeline, Sankey, C4, and other diagram types. The JavaScript library renders definitions dynamically in web pages and applications, while the Live Editor gives immediate visual feedback. A typical workflow starts with a developer opening the Live Editor, entering a flowchart definition such as nodes connected by labeled arrows, and adjusting the text until the layout communicates the intended process. The developer then saves that definition in a repository, places it in a Markdown file or application, and lets GitHub or a documentation system render the diagram. Changes remain visible in ordinary text diffs, and teams can configure themes, layouts, sanitization, or sandboxed rendering when publishing shared content.

Architecture and recent releases

Mermaid uses a JavaScript and TypeScript architecture with CSS, HTML, Vue, Langium, and parser tooling across its repository, distributing the library through npm and browser assets through a CDN. Text definitions are parsed into diagram models, passed to layout engines such as ELK, dagre, Cytoscape based layouts, and specialized renderers, then emitted as SVG in browser pages or applications. The project has no database requirement for rendering, so PostgreSQL, Redis, and object storage are unnecessary in a local or embedded deployment. Integration points include Markdown workflows, native GitHub rendering, the Live Editor, command line tooling, an HTTP server, npm, Yarn, pnpm, direct module scripts, and pinned internal browser assets. Mermaid 12.0.0 introduced ELK as the bundled default, UML use case diagrams, a new visual style, and requirements for ES2024, Safari 17.4 or newer, and Node 22.12 or newer. The latest release is mermaid 12.2.0, published October 13, 2026.

License and pricing

Mermaid’s core library is MIT licensed, granting rights to use it commercially, modify it, redistribute it, and include it in proprietary applications, subject to the license terms, including required notices and conditions. The open source code does not grant access to Mermaid Chart’s hosted features, quotas, collaboration controls, or AI allowances. Mermaid Chart Basic is free and includes up to six diagrams, limited diagram size, 15 AI credits, and one team and project. Plus costs $10 per user monthly when billed annually, with unlimited diagrams, limitless diagram size, and 300 annual AI credits. Premium costs $20 per user monthly when billed annually, adding 2,000 annual AI credits, unlimited free viewer seats, and unlimited teams and project creation. Enterprise pricing is custom and adds SSO, custom contracting and invoicing, IP management, and a dedicated customer success manager.

Limitations and how it compares

Mermaid’s main limitation is that text syntax gives up the precise object placement, freeform composition, and visual editing offered by canvas tools, while renderer or layout changes can alter established diagrams. Mermaid 12 also requires ES2024, Safari 17.4 or newer, and Node 22.12 or newer, which may exclude older environments. PlantUML is a comparable open-source option with established UML syntax and Java-based rendering, making it a fit where UML coverage and server tooling matter more than browser-first use. D2, another open-source alternative, also treats diagrams as code, but teams may prefer Mermaid when Markdown integration, GitHub rendering, and its broader collection of diagram grammars are priorities. Lucidchart is a proprietary hosted alternative with a canvas-oriented workflow, whereas Mermaid offers an MIT-licensed library for local embedding alongside separate hosted plans. Mermaid is ideal for developers, technical writers, and documentation teams that keep diagrams in repositories, code reviews, and automated builds.

Main features

  • Text Based Diagrams. Markdown inspired definitions keep diagrams editable as text, reviewable in diffs, and suitable for generated documentation.
  • Twenty Plus Types. Flowcharts, sequences, classes, states, ER models, Gantt charts, mindmaps, timelines, and Sankey diagrams use dedicated syntaxes.
  • Browser Rendering. The JavaScript library renders diagrams dynamically in web pages, applications, documentation systems, and local workflows.
  • Multiple Layouts. ELK is bundled as the version 12 default, while configuration can retain dagre or select specialized layouts.
  • Live Editor. Mermaid Live Editor provides immediate text editing and visual feedback without installing a desktop diagramming application.
  • Security Controls. Sanitization and sandboxed rendering modes help limit unsafe content when diagrams come from shared text.

Self-hosting Mermaid

Mermaid is a library rather than a server product. Self-hosting means installing npm packages, bundling Mermaid into a web application, serving browser assets from your own domain, or mirroring a pinned CDN copy internally. The Live Editor and Mermaid Chart are separate hosted applications. A local build uses Node.js and package tooling; Mermaid 12 documents Node 22.12 or newer and modern browsers. No PostgreSQL, Redis, object storage, or database is required for rendering. Pin versions, retain source definitions in version control, test layout changes before upgrades, and serve generated assets through normal documentation access controls.

Strengths

  • Text definitions produce clean diffs and fit code review.
  • MIT licensing permits commercial embedding and redistribution.
  • More than twenty diagram grammars cover technical documentation.
  • Browser, npm, CDN, GitHub, and editor integrations reduce friction.

Drawbacks

  • Complex layouts can change when the renderer changes.
  • Text syntax is less convenient than canvas tools for precise placement.
  • Mermaid 12 raises browser and Node compatibility requirements.

What teams replace with it

Teams usually evaluate Mermaid when they want to move off Lucidchart, Microsoft Visio, Gliffy.

For side-by-side commercial comparisons, browse our alternatives hub.

Open-source alternatives to Mermaid

  • PlantUML
  • D2
  • Graphviz
  • Kroki
  • Dagre

Frequently asked questions

Is Mermaid free?

The open source library is free under MIT. Mermaid Chart has a free Basic hosted plan with limits on diagrams, size, and AI. Plus and Premium cost $10 and $20 per user monthly when billed annually, while Enterprise is custom. Hosted service limits are separate from the library.

Can companies use Mermaid commercially?

Yes. MIT permits commercial use, modification, redistribution, and proprietary inclusion subject to license notices and conditions. Companies using Mermaid Chart must also follow service terms. Mermaid Chart features, quotas, collaboration controls, and AI credits are not automatically granted by the code license.

How do I self-host Mermaid?

Install the npm package and bundle it into an application, serve pinned browser assets internally, or mirror a release into a private registry. Rendering needs no database, Redis, or object store. Mermaid 12 documents Node 22.12 or newer and modern browser capabilities.

How does Mermaid compare with PlantUML?

Both keep diagrams as text. Mermaid is JavaScript based, browser friendly, and widely used in Markdown and GitHub. PlantUML has established UML syntax and Java based rendering. Choose Mermaid for browser first workflows and PlantUML when its UML syntax and server tooling fit better.

Is Mermaid safe for private documentation?

Local rendering can keep source and output inside an organization. The project documents sanitization and sandboxed rendering, but teams must configure controls for their threat model. Mermaid Chart is hosted, so review its terms, sharing behavior, and enterprise security options before uploading confidential diagrams.

Similar projects to compare

Sources

Last updated 2026-10-22.