惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
The Cloudflare Blog
博客园 - 聂微东
博客园 - 司徒正美
量子位
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Mermaid vs PlantUML in 2026: Which to Pick for Engineerin...
Levi Liu · 2026-06-03 · via DEV Community

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]

Enter fullscreen mode Exit fullscreen mode

PlantUML:

@startuml
start
:Client;
if (Token valid?) then (yes)
  :Fetch user;
  :Return 200;
else (no)
  :Redirect to login;
  :Return 302;
endif
@enduml

Enter fullscreen mode Exit fullscreen mode

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 rendered from Mermaid source

Same auth flow, Mermaid source, rendered into a finished SVG.

Same auth flow rendered from PlantUML source

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:

  1. Pre-rendering to SVG/PNG and committing the image, or
  2. 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:

  1. Does the diagram need to render on GitHub or in a markdown file consumed by tools you don't control? → Mermaid. Stop here.
  2. Does it need to be a deployment, component, or detailed class diagram with 30+ nodes? → PlantUML. Stop here.
  3. Anything else? → Mermaid for the lower install footprint and broader AI tooling; PlantUML if your team is already on JetBrains + Confluence.

Decision rule visualised as a three-question flow

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.)

→ Try the editor


The web flow:

  1. Paste the source — Mermaid or PlantUML — into the editor at /editor. The format is auto-detected.
  2. 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.
  3. 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

Enter fullscreen mode Exit fullscreen mode

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.