Going Stellar

Home/Methods

Mermaid · Diagrams

Mermaid vs PlantUML: syntax, setup and where each one renders

Both turn text into diagrams, and their sequence syntax is close. The practical difference is where they run: Mermaid is JavaScript that draws in the browser and is built into GitHub and GitLab, while PlantUML is a Java program that usually needs a server. Here are the same diagrams in both.

Updated

The same sequence diagram in both

PlantUML wraps every diagram in @startuml and @enduml and does not need a type line: it works out the type from the content. Its messages use -> and -->.

@startuml
Alice -> Bob: Authentication request
alt successful case
    Bob --> Alice: Authentication accepted
else failure
    Bob --> Alice: Authentication failure
end
@enduml

Mermaid starts with the type, sequenceDiagram, and writes messages with two arrowheads, ->> and -->>. The alt/else/end block is the same.

sequenceDiagram
    Alice->>Bob: Authentication request
    alt successful case
        Bob-->>Alice: Authentication accepted
    else failure
        Bob-->>Alice: Authentication failure
    end

Open this example in the editor (Mermaid vs PlantUML: the same sequence diagram).

Moving a sequence diagram from one to the other is mostly a search and replace of the arrows and the first and last lines.

The same class diagram

This is PlantUML's own example for its Smetana layout. In PlantUML, more dashes make a longer arrow:

@startuml
!pragma layout smetana
class Foo1
Foo1 --> Foo2
Foo1 --> Foo3
Foo1 ---> Foo4 : test 4
@enduml

In Mermaid the arrow length is not set by dashes; layout is automatic.

classDiagram
    class Foo1
    Foo1 --> Foo2
    Foo1 --> Foo3
    Foo1 --> Foo4 : test 4

Open this example in the editor (Mermaid vs PlantUML: the same class diagram).

Setup: Java, Graphviz, or a browser

MermaidPlantUML
Written inJavaScriptJava
Runsin the browserplantuml.jar, a server, or Docker
Needsnothing elseJava (11 or newer recommended); Graphviz for some diagrams
LicenceMITyour choice of several: GPL, LGPL, Apache 2.0, BSD, EPL, MIT

PlantUML needs Graphviz for use case, class, object, component, deployment and state diagrams and for the legacy activity syntax; other types do not use it. On Windows a compiled Graphviz is included. !pragma layout smetana switches to Smetana, PlantUML's Java port of Graphviz, so those diagrams render without installing Graphviz. PlantUML's site now also runs a JavaScript rendering engine in its online editor.

Where each one renders

MermaidPlantUML
GitHubbuilt in (mermaid code block)not built in; PlantUML offers a browser extension
GitLabbuilt in, Mermaid 12Self-Managed: an administrator sets up a PlantUML server and enables it
Obsidian, VS Code previewbuilt innot in their documentation

That difference decides it for most teams: a mermaid block in a README renders on GitHub and GitLab for everyone, with no server to run.

Diagram types

Both cover the common ones: sequence, class, state, activity or flowchart, ER, Gantt, mind map and timeline. PlantUML has more UML types, such as use case, object, component, deployment and timing diagrams, and non-UML ones such as wireframes (Salt), network diagrams, JSON and YAML data, and regular expressions. Mermaid has types PlantUML does not list, such as git graphs, Sankey diagrams and quadrant charts. It also draws C4 diagrams with built-in keywords:

C4Context
    title Online shop
    Person(customer, "Customer")
    System(shop, "Web shop")
    System_Ext(pay, "Payment provider")
    Rel(customer, shop, "Orders from")
    Rel(shop, pay, "Charges cards via")

Open this example in the editor (Mermaid: C4 context diagram).

Which one to pick

Pick Mermaid when the diagram lives next to code or docs in GitHub, GitLab, Obsidian or a Markdown preview, and readers should see it without setup. Pick PlantUML when you need the UML types Mermaid does not have, or a team already runs a PlantUML server and has diagrams in it. Converting between them is manual; neither imports the other's syntax.

Mermaid in Confluence

Confluence Cloud does not render Mermaid on its own. Mermaid Studio for Confluence, our app, does: type /Mermaid on a page, write or paste the code with a live preview, or start from one of eight templates (flowchart, sequence, Gantt, class, ER, state, pie, mind map). The diagram follows Confluence's light or dark mode, or keeps one of five themes. Copying the SVG is free; Pro adds downloads as PNG or SVG and an AI that writes the Mermaid from a plain-English description. It runs Mermaid 11.17.2, and every example on this page renders there as written.

Limits

The Mermaid examples were rendered on 29 November 2026 with Mermaid 12.3.0, the version in our editor, and with 11.17.2, the version in Mermaid Studio. The PlantUML code is copied from PlantUML's documentation and was not run by us. Facts about each tool come from its documentation, read the same day.

Sources

  1. PlantUML: home page (supported diagrams)
  2. PlantUML: Quick Start Guide
  3. PlantUML: Graphviz installation
  4. PlantUML: Smetana (Graphviz ported to Java)
  5. PlantUML: Sequence diagram
  6. PlantUML: Download and licenses
  7. Mermaid documentation: Sequence diagrams
  8. Mermaid documentation: Class diagrams
  9. Mermaid documentation: C4 diagrams
  10. GitHub Docs: Creating diagrams
  11. GitLab Docs: PlantUML (administration)
  12. Atlassian Marketplace: Mermaid Studio for Confluence (version 3.10.0)

Questions and answers

Is Mermaid easier than PlantUML?

For the common diagrams the syntax is similar. Mermaid is easier to set up: it needs no Java and renders in GitHub, GitLab and many Markdown tools with nothing installed.

Does GitHub render PlantUML?

Not by itself. GitHub's diagram support covers Mermaid, GeoJSON, TopoJSON and STL; PlantUML offers a browser extension for GitHub.

Can I convert PlantUML to Mermaid?

Not automatically with either tool. Sequence diagrams convert easily by hand: change the arrows and the first and last lines.

Does PlantUML need Graphviz?

Only for some diagrams: use case, class, object, component, deployment, state and legacy activity. !pragma layout smetana avoids it.

How to cite this

Going Stellar (2026). Mermaid vs PlantUML: syntax, setup and where each one renders. GOING STELLAR S.R.L..
https://goingstellar.ro/methods/mermaid-vs-plantuml/

Read as Markdown

All methods

Contact

Tell us what is not working

Write in English or Romanian. A person reads it — usually the same person who would do the work — and answers within one business day.