{"schemaVersion":"1.0","record":{"label":"Mermaid","description":"Open-source text-to-diagram renderer for documentation workflows, with host-version, layout and security configuration boundaries.","aliases":[],"kind":"software","website":"https://mermaid.js.org/","overview":"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.","license":"MIT","lifecycle":"active","example":false,"features":[{"name":"Text-defined diagrams","status":"supported","detail":"Renders supported diagram syntax into graphics.","useCase":"Maintain diagrams alongside technical documentation","platforms":["Web","JavaScript runtime","Command line"],"region":"Renderer version/build, runtime and host configuration requirements apply.","evidence":[{"url":"https://mermaid.js.org/intro/","locator":"Text-defined JavaScript diagram renderer and diagram types","retrievedAt":"2026-10-06T17:38:33Z","kind":"vendor"}]},{"name":"Host compatibility","status":"limited","detail":"Available syntax depends on the host's renderer version and build.","useCase":"Reuse definitions across documentation platforms","platforms":["Web","JavaScript runtime","Command line"],"region":"Renderer version/build, runtime and host configuration requirements apply.","evidence":[{"url":"https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams","locator":"Mermaid fenced blocks and renderer version compatibility","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"},{"url":"https://mermaid.js.org/config/usage.html","locator":"Runtime, Tiny build and security-mode boundaries","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"}]},{"name":"Batch graphic export","status":"supported","detail":"CLI converts definitions to SVG, PNG or PDF.","useCase":"Generate document assets reproducibly","platforms":["Web","JavaScript runtime","Command line"],"region":"Renderer version/build, runtime and host configuration requirements apply.","evidence":[{"url":"https://github.com/mermaid-js/mermaid-cli","locator":"Diagram source to SVG, PNG and PDF; Markdown rendering","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"}]},{"name":"Untrusted input controls","status":"limited","detail":"Security modes trade HTML and click behavior against isolation.","useCase":"Render externally supplied definitions","platforms":["Web","JavaScript runtime","Command line"],"region":"Renderer version/build, runtime and host configuration requirements apply.","evidence":[{"url":"https://mermaid.js.org/config/usage.html","locator":"Runtime, Tiny build and security-mode boundaries","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"}]}],"alternatives":[],"slug":"mermaid","draftAlternatives":[{"targetSlug":"draw-io","status":"limited","detail":"Source-driven layout and host version support differ from manual canvas editing.","useCase":"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.","evidence":[{"url":"https://mermaid.js.org/intro/","locator":"Text-defined JavaScript diagram renderer and diagram types","retrievedAt":"2026-10-06T17:38:33Z","kind":"vendor"},{"url":"https://mermaid.js.org/config/usage.html","locator":"Runtime, Tiny build and security-mode boundaries","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"},{"url":"https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams","locator":"Mermaid fenced blocks and renderer version compatibility","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"},{"url":"https://www.drawio.com/","locator":"Apache 2.0 source; free editor and storage choice","retrievedAt":"2026-10-06T17:38:04Z","kind":"vendor"}]}],"evidence":[{"url":"https://mermaid.js.org/intro/","locator":"Text-defined JavaScript diagram renderer and diagram types","retrievedAt":"2026-10-06T17:38:33Z","kind":"vendor"},{"url":"https://mermaid.js.org/config/usage.html","locator":"Runtime, Tiny build and security-mode boundaries","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"},{"url":"https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams","locator":"Mermaid fenced blocks and renderer version compatibility","retrievedAt":"2026-10-06T17:38:54Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://github.com/mermaid-js/mermaid/blob/develop/LICENSE","locator":"MIT license","retrievedAt":"2026-10-06T17:39:39Z","id":"mlicense","title":"Mermaid license","kind":"vendor"},{"url":"https://mermaid.js.org/intro/","locator":"Text-defined JavaScript diagram renderer and diagram types","retrievedAt":"2026-10-06T17:38:33Z","id":"mermaid","title":"About Mermaid","kind":"vendor"},{"url":"https://mermaid.js.org/config/usage.html","locator":"Runtime, Tiny build and security-mode boundaries","retrievedAt":"2026-10-06T17:38:54Z","id":"musage","title":"Mermaid usage","kind":"vendor"},{"url":"https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams","locator":"Mermaid fenced blocks and renderer version compatibility","retrievedAt":"2026-10-06T17:38:54Z","id":"mgithub","title":"GitHub diagram rendering","kind":"vendor"},{"url":"https://github.com/mermaid-js/mermaid-cli","locator":"Diagram source to SVG, PNG and PDF; Markdown rendering","retrievedAt":"2026-10-06T17:38:54Z","id":"mcli","title":"Mermaid CLI","kind":"vendor"},{"url":"https://mermaid.js.org/config/accessibility.html","locator":"Accessible titles and descriptions in rendered diagrams","retrievedAt":"2026-10-06T17:39:53Z","id":"maccess","title":"Mermaid accessibility","kind":"vendor"},{"url":"https://www.drawio.com/","locator":"Apache 2.0 source; free editor and storage choice","retrievedAt":"2026-10-06T17:38:04Z","id":"draw","title":"draw.io","kind":"vendor"},{"url":"https://www.drawio.com/docs/manual/export/export-to-png/","locator":"Optional embedded diagram data; current page versus whole multipage file","retrievedAt":"2026-10-06T17:38:43Z","id":"dimage","title":"draw.io PNG export","kind":"vendor"}],"overviewCitations":["mermaid","musage","mgithub"],"licenseCitations":["mlicense"],"sections":[{"id":"text-diagrams","heading":"Diagrams maintained as text","paragraphs":[{"id":"workflow","content":[{"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."}],"citations":["mermaid"]},{"id":"license","content":[{"text":"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."}],"citations":["mlicense","mermaid"]}]},{"id":"deployment","heading":"Embedding and rendering environments","paragraphs":[{"id":"integration","content":[{"text":"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."}],"citations":["musage","mgithub"]},{"id":"builds","content":[{"text":"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."}],"citations":["musage"]}]},{"id":"output","heading":"Exports and accessibility","paragraphs":[{"id":"cli","content":[{"text":"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."}],"citations":["mcli"]},{"id":"accessibility","content":[{"text":"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."}],"citations":["maccess"]}]},{"id":"security","heading":"Untrusted diagram input","paragraphs":[{"id":"modes","content":[{"text":"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."}],"citations":["musage"]}]},{"id":"comparison","heading":"Where it substitutes","paragraphs":[{"id":"drawio","content":[{"text":"Mermaid can substitute for "},{"text":"draw.io","targetSlug":"draw-io"},{"text":" 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."}],"citations":["mermaid","musage","mgithub","draw","dimage"]}]}]},"id":"Q1661","revision":1774,"updatedAt":"2026-10-25T22:12:23Z","sourceUrl":"https://substitutefor.net/entities/Q1661?revision=1774"}}