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?
| Point | Mermaid | PlantUML |
|---|---|---|
| Syntax | Its own, one keyword per diagram type (flowchart, sequenceDiagram, erDiagram) | Blocks between @startuml and @enduml |
| Diagram types | Flowchart, sequence, class, state, ER, user journey, Gantt, pie, mindmap, timeline, git graph, C4 and more, in the Mermaid docs | Sequence, use case, class, activity, component, state, object, deployment, timing, Gantt, mindmap, WBS, JSON, YAML and more, per PlantUML's start page |
| How it renders | JavaScript, so a browser can draw it | Needs Java (Java 11 or later is recommended); some diagram types also need Graphviz |
| Output | SVG in the page; PNG and SVG files with mermaid-cli or an editor | PNG and SVG, among others, from the command line or a PlantUML server |
| GitHub | Rendered in Markdown, per GitHub's docs | Not in GitHub's list of diagram syntaxes |
| GitLab | Rendered in Markdown, per GitLab's docs | On GitLab.com yes; on a self-managed instance an admin must set up a PlantUML server |
| Obsidian | Built in: a mermaid code block, per Obsidian's help | Not mentioned in Obsidian's help on built-in syntax |
| Folio | A Mermaid block on the page, edited visually or as code | No PlantUML renderer |
| License | MIT, per the Mermaid repository | GPL 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.
sequenceDiagram
Alice->>Bob: Hello
Bob-->>Alice: Hi@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi
@endumlFor 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.
Related
More from the blog
- Folio 0.4.4: notifications, review of agent edits, page owners and team skills
- Folio 0.4.3: a calmer interface, redesigned after your feedback
- MCP security for a wiki: OAuth, tokens and page permissions
- LLM wiki for a team: Markdown in Git, readable by agents over MCP
- Obsidian Bases outside Obsidian: open and edit .base files in a browser
- Obsidian MCP: ways to give an AI agent your vault
- Notion vs Obsidian for a team: what each one gives you, and when neither fits
- Groups and single sign-on in an open-source wiki: free, in one MIT edition
- Side-by-side comparison of wiki pages and versions: see what changed
- Publish a Cursor canvas to your team wiki: dashboards that outlive the chat
- Publish a Claude artifact to your team wiki: interactive pages that live in Git
- Make any page a template: custom templates for your Folio space
- Confluence MCP, Notion MCP and a wiki that is its own MCP server
- Export Confluence to Markdown and keep it in Git
- See how your team's knowledge connects: graph, Canvas and Bases in Folio 0.4
- Open an Obsidian vault as a team wiki, without changing a file
- Publish a wiki space as a public website, and let visitors ask it questions
- New hires ask the wiki, and the wiki learns what it lacks
- Folio boards: built on Excalidraw, made for teams