# Mermaid

Open\-source text\-to\-diagram renderer for documentation workflows, with host\-version, layout and security configuration boundaries\.

ID: Q1661 · Revision: 1774

Type: software · License: MIT[^mlicense] · Status: active

Website: https://mermaid.js.org/



Mermaid renders diagrams from text definitions instead of relying on manual placement on a drawing canvas\. It can be embedded into documentation systems or used through editors and command\-line tools\. Renderer versions, deployment configuration and the distinction between source text and exported graphics are important substitution boundaries\.[^mermaid][^musage][^mgithub]

## Diagrams maintained as text

Mermaid is a JavaScript\-based renderer for diagrams described using a Markdown\-inspired syntax\. Supported diagram families include flowcharts, sequence diagrams, class diagrams and entity relationships\. Its documentation\-oriented workflow makes the textual definition the editable source, allowing diagram changes to accompany changes to surrounding technical documentation\.[^mermaid]

The core project is MIT\-licensed\. It can be integrated into another application or rendered through supporting tools; the software license should not be conflated with the accounts, pricing or collaboration features of a particular hosted editor\. This article concerns the Mermaid renderer and its documented ecosystem rather than a commercial diagramming subscription\.[^mlicense][^mermaid]

## Embedding and rendering environments

A website can load Mermaid and render marked diagram definitions into SVG\. Existing documentation platforms can provide their own integration instead\. GitHub, for example, renders Mermaid fenced blocks and advises checking its current Mermaid version when syntax fails\. A diagram supported by the newest upstream renderer may not yet work in every host\.[^musage][^mgithub]

The current usage guide distinguishes the full package from Mermaid Tiny\. The smaller build omits features including mindmaps, architecture diagrams, KaTeX and the ELK layout engine\. Its documented layout fallback means that reducing deployment size can change the rendered arrangement, even when a diagram still renders successfully\.[^musage]

## Exports and accessibility

The Mermaid command\-line project converts diagram definitions into SVG, PNG or PDF and can process Mermaid blocks in Markdown\. This supports repeatable document\-generation workflows\. Keeping the definition alongside exported graphics preserves an editable source rather than relying on a screenshot as the only remaining representation\.[^mcli]

Mermaid provides accessible title and description fields that are reflected in the rendered SVG’s accessibility attributes\. These fields let an author supply context beyond the visible labels\. Merely choosing a diagram renderer does not write that explanation; its usefulness depends on the information supplied by the diagram author\.[^maccess]

## Untrusted diagram input

The default strict security setting encodes HTML tags and disables click behavior\. Other settings change that trust boundary, while sandbox mode renders inside an isolated frame and can limit interactivity\. These are deployment choices for the application accepting diagram text, not a reason to assume every embedded diagram is safe under any configuration\.[^musage]

## Where it substitutes

Mermaid can substitute for draw\.io for flowcharts and technical diagrams maintained as part of text\-based documentation\. It changes the authoring method from direct canvas editing to source definitions and renderer\-controlled layout\. Host syntax support, custom visual requirements and the need for interactive manual arrangement constrain that substitution\.[^mermaid][^musage][^mgithub][^draw][^dimage]

## Capabilities and substitutions

### Text\-defined diagrams — supported

Renders supported diagram syntax into graphics\.[^mermaid]

Use case: Maintain diagrams alongside technical documentation · Platforms: Web, JavaScript runtime, Command line · Region: Renderer version/build, runtime and host configuration requirements apply\.

### Host compatibility — limited

Available syntax depends on the host's renderer version and build\.[^musage][^mgithub]

Use case: Reuse definitions across documentation platforms · Platforms: Web, JavaScript runtime, Command line · Region: Renderer version/build, runtime and host configuration requirements apply\.

### Batch graphic export — supported

CLI converts definitions to SVG, PNG or PDF\.[^mcli]

Use case: Generate document assets reproducibly · Platforms: Web, JavaScript runtime, Command line · Region: Renderer version/build, runtime and host configuration requirements apply\.

### Untrusted input controls — limited

Security modes trade HTML and click behavior against isolation\.[^musage]

Use case: Render externally supplied definitions · Platforms: Web, JavaScript runtime, Command line · Region: Renderer version/build, runtime and host configuration requirements apply\.

### Substitute for draw\-io (catalog entry pending) — limited

Source\-driven layout and host version support differ from manual canvas editing\.[^mermaid][^musage][^mgithub][^draw]

Use case: Maintain flowcharts and technical diagrams in text\-based documentation · Platforms: Web, JavaScript runtime, Command line · Region: Renderer version/build, runtime and host configuration requirements apply\.

## References

[^mlicense]: [Mermaid license](<https://github.com/mermaid-js/mermaid/blob/develop/LICENSE>) — MIT license (vendor; retrieved 2026-10-06T17:39:39Z)

[^mermaid]: [About Mermaid](<https://mermaid.js.org/intro/>) — Text\-defined JavaScript diagram renderer and diagram types (vendor; retrieved 2026-10-06T17:38:33Z)

[^musage]: [Mermaid usage](<https://mermaid.js.org/config/usage.html>) — Runtime, Tiny build and security\-mode boundaries (vendor; retrieved 2026-10-06T17:38:54Z)

[^mgithub]: [GitHub diagram rendering](<https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams>) — Mermaid fenced blocks and renderer version compatibility (vendor; retrieved 2026-10-06T17:38:54Z)

[^mcli]: [Mermaid CLI](<https://github.com/mermaid-js/mermaid-cli>) — Diagram source to SVG, PNG and PDF; Markdown rendering (vendor; retrieved 2026-10-06T17:38:54Z)

[^maccess]: [Mermaid accessibility](<https://mermaid.js.org/config/accessibility.html>) — Accessible titles and descriptions in rendered diagrams (vendor; retrieved 2026-10-06T17:39:53Z)

[^draw]: [draw\.io](<https://www.drawio.com/>) — Apache 2\.0 source; free editor and storage choice (vendor; retrieved 2026-10-06T17:38:04Z)

[^dimage]: [draw\.io PNG export](<https://www.drawio.com/docs/manual/export/export-to-png/>) — Optional embedded diagram data; current page versus whole multipage file (vendor; retrieved 2026-10-06T17:38:43Z)

Source revision: https://substitutefor.net/entities/Q1661?revision=1774
