TL;DR
Mermaid won the README and the markdown ecosystem; PlantUML won the engineering whiteboard and the IDE. In 2026 they're still the two serious "diagram as code" formats, and which one you should pick depends on where the diagram lives more than what it shows. This post compares them on syntax, layout, diagram coverage, and ecosystem, ending with a decision rule you can apply in 60 seconds. Both render through the same editor if you want to try them side by side without installing anything.
The honest framing
I've shipped engineering docs with both. Every six months someone on the team asks "should we standardise on Mermaid or PlantUML?" and every six months the answer is "it depends on where the diagram lives."
That answer used to be a cop-out. In 2026 it's the truth. The two formats have converged on the same problem — render diagrams from plain text — and diverged on everything around it: who writes them, where they render, what they look like, and how much patience they expect from you.
This article is the side-by-side I wish someone had handed me three years ago.
At a glance
The table you came here for:
| Dimension | Mermaid | PlantUML |
|---|---|---|
| Native rendering on GitHub | ✅ since 2022 | ❌ (proxied images only) |
| Native rendering on Notion | ✅ | ❌ |
| Native rendering on GitLab | ✅ | ✅ |
| IDE / editor extensions | Broad (VS Code, JetBrains, Obsidian) | Broad, with deeper JetBrains roots |
| Layout engine | Dagre (flowcharts), ELK opt-in | Graphviz (dot) |
| Supported diagram types | ~16 | ~20+ |
| Syntax style | Markdown-adjacent | Annotation-heavy |
| Server-side renderer | Headless Chromium | Java + Graphviz |
| Best at | Flowcharts, sequence, journey | Class, component, deployment, ERD |
| Worst at | Dense ERDs, large class diagrams | Anything that needs to live on GitHub |
The rest of this post is the detail under each row.
Round 1 — Syntax ergonomics
The same flow, written two ways. Pick which one reads more naturally to you.
Mermaid:
flowchart TD
A[Client] --> B{Token valid?}
B -->|Yes| C[Fetch user]
B -->|No| D[Redirect to login]
C --> E[Return 200]
D --> F[Return 302]
PlantUML:
@startuml
start
:Client;
if (Token valid?) then (yes)
:Fetch user;
:Return 200;
else (no)
:Redirect to login;
:Return 302;
endif
@enduml
Mermaid's syntax leans on nodes and edges as the primitive. You say "A points to B with this label" and the layout follows. It reads like a constraint list.
PlantUML's syntax leans on statements as the primitive. You say "do this, then this, with this branch" and the layout follows. It reads like pseudocode.
For people who think in flow ("first this happens, then this"), PlantUML's start/if/endif is intuitive. For people who think in graphs ("these are the nodes, these are the edges"), Mermaid is the lower-friction path.
There's no objectively-better here. Pick the one that matches how your team already whiteboards.
Same auth flow, Mermaid source, rendered into a finished SVG.
Same flow expressed in PlantUML — different syntax, same end shape.
Round 2 — Layout quality
Layout is where the two diverge the most, and it's the thing nobody talks about until they've shipped a dozen diagrams and realised one of the formats keeps making nodes overlap.
Mermaid uses Dagre by default. Dagre is a hierarchical layout algorithm — fast, deterministic, and great on flow charts with 5 to 30 nodes. Past that it starts producing the visual you've seen on a thousand READMEs: tall, narrow columns with edges crossing in ways no human would draw.
Mermaid has an elk opt-in (Eclipse Layout Kernel) that's much better at dense graphs. As of 2026 it's still flagged as experimental in most distributions, but it's stable enough to use in production.
PlantUML uses Graphviz (the dot engine), which has been the gold standard for hierarchical graph layout for 30 years. The output reflects that — PlantUML diagrams routinely look right out of the box, especially as the graph grows past 20 nodes.
For a 6-node flow chart, both produce something readable. For a 60-node class diagram, PlantUML wins by a noticeable margin.
The catch: Graphviz is a native binary. Running PlantUML in a CI job or a serverless function means shipping a Java + Graphviz runtime. Mermaid is JavaScript end-to-end, which is the trade.
Round 3 — Supported diagram types
Both cover the basics; PlantUML covers more obscure ones.
Mermaid (2026, native pack):
- Flowchart
- Sequence diagram
- Class diagram
- State diagram
- ER diagram
- Gantt
- Pie
- User journey
- Quadrant chart
- XY chart
- Mindmap
- Timeline
- Sankey
- Block diagram
- Git graph
- C4 (experimental)
PlantUML (mature set):
- All of the above, plus:
- Component diagram
- Deployment diagram
- Activity diagram (legacy + beta)
- Use case
- Object diagram
- Network diagram (
nwdiag) - Wireframe (Salt UI mockup)
- Archimate
- BPMN-like activity flows
- Bytefield diagrams
If you're writing a software architecture doc that needs deployment diagrams or component diagrams — the boxes-inside-boxes-with-interfaces pattern — PlantUML's coverage is meaningfully wider. Mermaid's block diagram type covers a chunk of this, but it's not at parity.
If you're writing a feature spec with flowcharts, sequence diagrams, and ER diagrams — the 80% case for product engineering — both are fine.
Round 4 — Where it renders without help
This is the single biggest practical difference, and the reason the answer in 2026 is "it depends on where the diagram lives".
Mermaid renders natively on:
- GitHub READMEs and markdown files (since 2022)
- GitLab
- Notion code blocks
- VS Code markdown preview
- Obsidian
- Bitbucket Cloud
- Most static site generators with a plugin (Docusaurus, VitePress, MkDocs Material, Astro)
PlantUML renders natively on:
- GitLab (snippets + wiki)
- JetBrains IDEs (with the official plugin)
- Confluence (with a plugin)
Everywhere else, PlantUML rendering means either:
- Pre-rendering to SVG/PNG and committing the image, or
- Pointing at a public PlantUML server (
www.plantuml.com/plantuml/svg/<encoded>) and accepting that your diagram source is encoded into a third-party URL.
For a GitHub README in 2026, Mermaid is the only format that renders inline without a build step. That's not a small thing — it's the entire reason Mermaid has more momentum.
For an internal Confluence-driven engineering org, PlantUML's class / component / deployment coverage and Graphviz layout makes it the better default.
Round 5 — Ecosystem and tooling
Both ecosystems are healthy. They optimise for different surfaces.
Mermaid:
- Maintained by a foundation; weekly releases
- Live editor at
mermaid.live - Official CLI:
@mermaid-js/mermaid-cli(uses Puppeteer under the hood) - VS Code extension by the maintainers
- Obsidian native support
- AI tooling generates Mermaid by default — most LLMs output Mermaid when asked for a diagram in markdown
PlantUML:
- Maintained primarily by Arnaud Roques and a small team; releases are slower but steady
- Live editor at
www.plantuml.com/plantuml - Official tool:
plantuml.jar(Java) - JetBrains plugin is best-in-class for the JVM crowd
- Confluence integration is a paid plugin but widely deployed
- AI tooling support is improving but still trails Mermaid
There's a quieter consequence here. When you ask an LLM for "a diagram of X", you almost always get Mermaid back. That's mostly habit and training-set bias, not a quality call — but it does mean that if your team is leaning on AI-assisted doc writing, Mermaid will show up in your repo whether you picked it or not.
Round 6 — Learning curve
The bottom 20% of each language takes about an hour. The remaining 80% is what differs.
Mermaid has a flat learning curve — the syntax is markdown-adjacent and most people write a working flowchart on their first try. The wall comes when you want to customise — themeVariables, init directives, classDef, link styling — because each diagram type has its own subset of the customisation surface, and the documentation is scattered.
PlantUML has a steeper start — @startuml / @enduml, statement-based syntax, skinparam overrides — but a flatter middle, because once you've learned skinparam you've learned the customisation surface for every diagram type. The wall comes later, around legacy syntax (the original activity grammar vs the newer start/stop beta).
For a team that ships occasional diagrams, Mermaid's flat start wins. For a team where someone "owns" the diagram system and is going to push it to its limits, PlantUML's consistency wins.
The decision rule
Three questions, in order:
- Does the diagram need to render on GitHub or in a markdown file consumed by tools you don't control? → Mermaid. Stop here.
- Does it need to be a deployment, component, or detailed class diagram with 30+ nodes? → PlantUML. Stop here.
- Anything else? → Mermaid for the lower install footprint and broader AI tooling; PlantUML if your team is already on JetBrains + Confluence.
The 60-second decision rule.
Most engineering teams in 2026 end up using Mermaid for repo-level docs and PlantUML for architecture documents that live in Confluence or a wiki. That's not a compromise — it's the right answer. The cost of standardising on one format and forcing the wrong fit is higher than the cost of two file extensions in your repo.
Both formats, one editor: Don't pick — render both
Beauty Diagram parses Mermaid, PlantUML, and draw.io. Paste either format, pick from 9 production themes, export SVG or PNG. Useful when your docs repo has both formats and you want them to look consistent. (Disclosure: I work on it.)
The web flow:
- Paste the source — Mermaid or PlantUML — into the editor at /editor. The format is auto-detected.
-
Pick a theme. The same nine themes (
classic,modern,atlas,blueprint,memphis,obsidian,slate,brutalist,atelier) apply to both formats, so a doc with a mix of Mermaid and PlantUML diagrams renders consistently. - Export SVG or PNG, or use Share to get a hot-linkable URL.
If you're scripting this from CI — say, beautifying every diagram in your docs repo on each release — the same pipeline runs from a CLI:
# Works on both Mermaid and PlantUML files
npx @beauty-diagram/cli beautify auth.mmd --theme atlas --out auth.svg
npx @beauty-diagram/cli beautify components.puml --theme atlas --out components.svg
bd themes lists the available themes. There's no per-property style override — the theme is the choice; you pick a different one if you don't like what you see.
Wrap-up
The 60-second version:
- Mermaid wins if the diagram lives in a README, a markdown file, a Notion page, or anything you don't fully control. It also wins if you're heavy on AI-assisted doc writing.
- PlantUML wins if the diagram is a deployment / component / detailed class diagram, or if your team is centred on JetBrains + Confluence.
- Both is fine. Pick the format per-diagram, not per-org.
If this was useful, drop a ❤️ and follow — I'm posting weekly on diagrams, docs, and developer ergonomics. Next week: Generate Mermaid from plain English with AI — a CLI walkthrough.
Which one is your team standardised on, and did the decision survive the second year? Drop a note in the comments — I'm collecting the regret-or-validation stories.



Top comments (0)