---
title: "Mermaid vs PlantUML: syntax, setup and where each one renders"
description: "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."
date: 2026-11-29
lang: en
canonical: https://goingstellar.ro/methods/mermaid-vs-plantuml/
author: Going Stellar
publisher: GOING STELLAR S.R.L.
topic: Mermaid / Diagrams
license: CC BY 4.0
alternate_ro: https://goingstellar.ro/ro/metode/mermaid-sau-plantuml-comparatie/
---

# 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.*

> Mermaid · Diagrams · 2026-11-29 · https://goingstellar.ro/methods/mermaid-vs-plantuml/

## Key points

- PlantUML wraps diagrams in `@startuml`/`@enduml`; Mermaid starts with a type line.
- Sequence syntax is close: `-&gt;` in PlantUML is `-&gt;&gt;` in Mermaid.
- PlantUML needs Java, and Graphviz for some diagrams unless you use Smetana; Mermaid needs only a browser.
- GitHub and GitLab render Mermaid out of the box; PlantUML needs a server or an extension.

## 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 `-&gt;` and `--&gt;`.

```plantuml
@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, `-&gt;&gt;` and `--&gt;&gt;`. The `alt`/`else`/`end` block is the same.

```mermaid
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:

```plantuml
@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.

```mermaid
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

|  | Mermaid | PlantUML |
|---|---|---|
| Written in | JavaScript | Java |
| Runs | in the browser | `plantuml.jar`, a server, or Docker |
| Needs | nothing else | Java (11 or newer recommended); Graphviz for some diagrams |
| Licence | MIT | your 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

|  | Mermaid | PlantUML |
|---|---|---|
| GitHub | built in (`mermaid` code block) | not built in; PlantUML offers a browser extension |
| GitLab | built in, Mermaid 12 | Self-Managed: an administrator sets up a PlantUML server and enables it |
| Obsidian, VS Code preview | built in | not 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:

```mermaid
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)](https://plantuml.com/)
2. [PlantUML: Quick Start Guide](https://plantuml.com/starting)
3. [PlantUML: Graphviz installation](https://plantuml.com/graphviz-dot)
4. [PlantUML: Smetana (Graphviz ported to Java)](https://plantuml.com/smetana02)
5. [PlantUML: Sequence diagram](https://plantuml.com/sequence-diagram)
6. [PlantUML: Download and licenses](https://plantuml.com/download)
7. [Mermaid documentation: Sequence diagrams](https://mermaid.js.org/syntax/sequenceDiagram.html)
8. [Mermaid documentation: Class diagrams](https://mermaid.js.org/syntax/classDiagram.html)
9. [Mermaid documentation: C4 diagrams](https://mermaid.js.org/syntax/c4.html)
10. [GitHub Docs: Creating diagrams](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams)
11. [GitLab Docs: PlantUML (administration)](https://docs.gitlab.com/administration/integration/plantuml/)
12. [Atlassian Marketplace: Mermaid Studio for Confluence (version 3.10.0)](https://marketplace.atlassian.com/apps/1011179388/mermaid-studio-ai-mermaid-diagram-editor)

## 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

**Cite this as:** 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/

```bibtex
@misc{goingstellar2026mermaid,
  title  = {Mermaid vs PlantUML: syntax, setup and where each one renders},
  author = {{Going Stellar}},
  year   = {2026},
  url    = {https://goingstellar.ro/methods/mermaid-vs-plantuml/},
  note   = {2026-11-29}
}
```

Licence. Free to quote with attribution.

## Also available

- This page as HTML: https://goingstellar.ro/methods/mermaid-vs-plantuml/
- Same article in Romanian: https://goingstellar.ro/ro/metode/mermaid-sau-plantuml-comparatie/
