Skip to content

Mermaid vs PlantUML: which to use for docs in Git

· Sergii Kravtsov · Folio

Use Mermaid when the diagram lives in Markdown on GitHub, GitLab or in Obsidian: it renders there without setup and runs in a browser. Use PlantUML when you need UML types Mermaid does not list, such as component, deployment, object or activity diagrams, and you can run Java or a PlantUML server. Both are free to use and both draw diagrams from text.

What follows is a side-by-side table, two code samples, and a short list of where each one wins. Facts about both tools come from their own documentation, checked on 2 November 2026, and links go to the source.

Mermaid vs PlantUML: what is different?

Mermaid and PlantUML compared on the same points
PointMermaidPlantUML
SyntaxIts own, one keyword per diagram type (flowchart, sequenceDiagram, erDiagram)Blocks between @startuml and @enduml
Diagram typesFlowchart, sequence, class, state, ER, user journey, Gantt, pie, mindmap, timeline, git graph, C4 and more, in the Mermaid docsSequence, use case, class, activity, component, state, object, deployment, timing, Gantt, mindmap, WBS, JSON, YAML and more, per PlantUML's start page
How it rendersJavaScript, so a browser can draw itNeeds Java (Java 11 or later is recommended); some diagram types also need Graphviz
OutputSVG in the page; PNG and SVG files with mermaid-cli or an editorPNG and SVG, among others, from the command line or a PlantUML server
GitHubRendered in Markdown, per GitHub's docsNot in GitHub's list of diagram syntaxes
GitLabRendered in Markdown, per GitLab's docsOn GitLab.com yes; on a self-managed instance an admin must set up a PlantUML server
ObsidianBuilt in: a mermaid code block, per Obsidian's helpNot mentioned in Obsidian's help on built-in syntax
FolioA Mermaid block on the page, edited visually or as codeNo PlantUML renderer
LicenseMIT, per the Mermaid repositoryGPL by default; LGPL, Apache, Eclipse Public and MIT builds exist with fewer features, per the PlantUML FAQ

What does the same diagram look like in each?

The same two-message exchange. Mermaid names the diagram type on the first line. PlantUML wraps the diagram in start and end markers.

Mermaid
sequenceDiagram
  Alice->>Bob: Hello
  Bob-->>Alice: Hi
PlantUML
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi
@enduml

For a simple diagram the difference is small. It grows with the diagram: Mermaid has one syntax per type with a few shared ideas, and PlantUML has its own keywords, styling and include options for each of its types.

Where is Mermaid the better choice?

  • It renders where your docs already are. GitHub, GitLab and Obsidian draw a mermaid block with no plugin and no server, so the Markdown file is the diagram.
  • Nothing to install. It is JavaScript, so a browser draws it, and a live editor needs no account.
  • A permissive license. MIT is simple to use in a product or a company wiki.
  • Easy to edit by people who do not write code. Visual editors work on Mermaid; ours, for example, adds nodes with a plus button and writes the code for you.

Where is PlantUML the better choice?

  • More UML types. Component, deployment, object, activity and timing diagrams are in PlantUML's list, and Mermaid's list has no diagram of those names. Mermaid has types PlantUML does not list, such as pie and git graph.
  • Output from a server or a build. If a build already runs Java, PlantUML turns text files into PNG or SVG with no browser involved.
  • An older, large ecosystem. It has been used for UML in documentation for a long time, so many teams already have PlantUML files.

How do I pick one?

  • Docs in Markdown on GitHub, GitLab or Obsidian, mostly flowcharts, sequences, ER and Gantt: Mermaid.
  • Formal UML with types Mermaid does not have, and a build or server that can run Java: PlantUML.
  • Both in one repository: allowed, but readers on GitHub will see the PlantUML as code. Say in the file which tool draws it.
  • Starting from nothing: try the same diagram in both for ten minutes. The syntax you can read a month later is the right one.

What does Folio do with each?

In Folio a Mermaid diagram is a block on the page, stored as an ordinary mermaid code block in the Markdown file, so the file renders on GitHub and GitLab as well. You can edit it on a canvas or as code. Mermaid diagrams in a team wiki shows three examples, and the Mermaid live editor is the same editor for free in your browser, with PNG and SVG export. For hand-drawn pictures Folio has boards built on Excalidraw.

What Folio does not do: it has no PlantUML renderer, so a PlantUML block is not drawn as a diagram, and the live editor does not read PlantUML. If your diagrams are PlantUML, render them to SVG or PNG outside Folio and add the image, or move them to Mermaid where the type exists.

Try it

Paste the Mermaid sample above into the live editor, then change it on the canvas. For a Gantt chart or an ER diagram, the same page has short examples with code. To keep diagrams next to the pages that explain them, read docs-as-code in the browser.

Frequently asked questions

Is Mermaid or PlantUML better for documentation in Git?

For Markdown docs on GitHub, GitLab or in Obsidian, Mermaid: those render a mermaid block directly. PlantUML fits when you need UML types Mermaid does not list and can run Java or a PlantUML server.

Does GitHub render PlantUML?

GitHub's documentation lists Mermaid, GeoJSON, TopoJSON and ASCII STL as the diagram syntaxes it renders in Markdown. PlantUML is not among them, so a PlantUML block shows as code unless you render it to an image first.

Does GitLab support Mermaid and PlantUML?

GitLab renders Mermaid in Markdown. PlantUML works on GitLab.com without setup, and on a self-managed instance an administrator has to configure a PlantUML server first.

Is PlantUML free, and what license is it under?

PlantUML is distributed under the GPL, and its FAQ lists LGPL, Apache, Eclipse Public and MIT builds as alternatives that miss a few features. Mermaid is MIT licensed.

Does Mermaid need Java or a server?

No. Mermaid is JavaScript and a browser draws it. PlantUML needs Java, and some diagram types need Graphviz as well. To make Mermaid PNG or SVG files in a script, mermaid-cli does it, and our live editor exports both in the browser.

Can I use PlantUML in Folio?

Not as a diagram: Folio has no PlantUML renderer. It draws Mermaid blocks and has Excalidraw boards. Render PlantUML to SVG or PNG elsewhere and add the image, or redraw it in Mermaid.

See it in a running Folio

Open the live demo and click through a real Folio instance, or install it and move one space over. Folio is open source and stores everything in Git.

All posts