Skip to main content

Create Mermaid diagrams in Confluence: a step-by-step guide

· 6 min read

Mermaid diagrams in Confluence let you create flowcharts, sequence diagrams, and more using simple text syntax. This guide covers Confluence Mermaid setup with Mermaid Plus — live preview, 30 diagram types, and copy-paste examples.

Who should read this
  • Developers adding diagrams to Confluence documentation
  • Teams switching from draw.io to text-based diagrams (see Excalidraw vs draw.io if you're comparing visual tools too)
  • Anyone needing flowcharts, sequence diagrams, or ER diagrams in Confluence
What you'll learn
  1. How to set up Mermaid in Confluence
  2. Creating flowcharts, sequence diagrams, Gantt charts
  3. All 30 supported diagram types with examples
  4. Troubleshooting common issues

Quick prerequisites​

  • Confluence Cloud with Mermaid Plus (or Mermaid-enabled) app installed
  • Basic familiarity with Markdown-style editing in Confluence

How to insert a Mermaid diagram​

  1. Edit a Confluence page.
  2. Insert the Mermaid macro (type /mermaid and choose the plugin).
  3. Paste one of the examples below into the editor and preview.
  4. Adjust labels, colors, and sizes as needed, then save.

Best practices​

  • Start small and iterate: preview often while editing.
  • Use templates for repetitive diagrams.
  • Prefer simple node labels for readability.
  • Use theme and color settings for accessible contrast.

Full list of common Mermaid diagram types (with examples)​

Flowchart (graph)​

A directed graph for processes and workflows.

graph TD
A[Start] --> B{Is it ok?}
B -- Yes --> C[Proceed]
B -- No --> D[Fix issue]
D --> B
C --> E[Done]

Sequence diagram (sequenceDiagram)​

Interaction over time between participants.

sequenceDiagram
participant Alice
participant Bob
Alice->>Bob: Request data
Bob-->>Alice: Return result
Alice->>Bob: Acknowledge

Class diagram (classDiagram)​

Model object-oriented classes and relationships.

classDiagram
class Animal {
+int age
+eat()
}
class Dog {
+bark()
}
Animal <|-- Dog

State diagram (stateDiagram-v2)​

Finite state machine transitions.

stateDiagram-v2
[*] --> Idle
Idle --> Processing : start
Processing --> Done : finish
Done --> [*]

Entity-Relationship (erDiagram)​

Database entities and relations.

erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
CUSTOMER {
string name
int id
}

Gantt chart (gantt)​

Project timelines with tasks and dependencies.

gantt
title Project Schedule
dateFormat YYYY-MM-DD
section Design
Research :a1, 2026-05-01, 10d
Develop :after a1, 20d
Test :2026-06-01, 10d

Pie chart (pie)​

Simple proportional data visualization.

pie title Time Allocation
"Development" : 50
"Testing" : 30
"Meeting" : 20

Git graph (gitGraph)​

Visualize branch and commit history.

gitGraph
commit
branch develop
checkout develop
commit
checkout main
merge develop
commit

Mindmap (mindmap)​

Hierarchical brainstorming diagrams.

mindmap
root((Product))
Features
Performance
UX
Roadmap
Q2
Q3

Timeline (timeline)​

Chronological events.

timeline
title Company milestones
2019 : Founded
2020 : First release
2022 : Series A

Requirement diagram (requirementDiagram)​

Traceability of requirements to elements.

requirementDiagram
requirement R1 {
id: 1
text: "Data export must support CSV"
}
element E1 {
type: component
}
E1 - satisfies -> R1

C4 & Architecture (C4Context)​

High-level system context diagrams.

C4Context
title System Context
Person(user, "User")
System(api, "Public API")
Rel(user, api, "Uses")

Quadrant chart (quadrantChart)​

Two-axis analysis charts.

quadrantChart
title Feature Analysis
x-axis Low --> High
y-axis Low --> High
quadrant-1 Prioritize
quadrant-2 Consider
Item A: [0.7, 0.6]
Item B: [0.2, 0.8]

Sankey diagram (sankey)​

Bulk flow volumes between nodes.

sankey
A [Source] -> B [Target] : 100
A -> C : 50
C -> B : 30

XY chart (xychart)​

Line and bar charts for time-series or categorical data.

xychart
title Revenue
x-axis [Q1,Q2,Q3,Q4]
y-axis "USD"
line [30,40,50,60]

Block diagram (block)​

Simple block/column diagrams.

block
A[Frontend] --> B[API]
B --> C[Database]

Packet diagram (packet)​

Network packet structure.

packet
0-15: Source Port
16-31: Destination Port
32-63: Sequence Number

Kanban (kanban)​

Board-style task flow.

kanban
To Do
Task A
In Progress
Task B
Done
Task C

Treemap (treemap)​

Hierarchical data as nested rectangles.

treemap
"Category A"
"Item 1" : 10
"Item 2" : 20

Ishikawa / Fishbone (ishikawa)​

Cause-and-effect analysis.

ishikawa
Problem: "Low throughput"
People
Lack of training
Process
Missing steps

Venn diagram (venn)​

Set relationships.

venn
A
B
A & B

ZenUML (zenuml)​

Alternative sequence diagram syntax.

zenuml
title Login Flow
Actor User
System API
User -> API: login()

Troubleshooting & tips​

  • If diagrams don't render, check the plugin settings or try the Mermaid Live Editor to validate syntax.
  • Use small examples while iterating; large diagrams can be hard to edit inside Confluence.
  • For accessibility, prefer clear color contrasts and short labels.

Does Confluence support Mermaid natively?​

No. Confluence Cloud has no built-in macro or feature that renders Mermaid syntax — typing Mermaid into a page shows literal text. Adding Mermaid diagrams requires a Marketplace app. The sections above use Mermaid Plus; the rest of this guide applies to any Mermaid-rendering app.

Paste an existing Markdown document​

If your diagrams already live in a Markdown file (a repo README, a design doc), pasting is a three-step workflow rather than a rebuild:

  1. Insert a Markdown macro — type /enhanced markdown in the editor. You get a split view: source on the left, live preview on the right.
  2. Paste the whole file, not just the diagram. Headings, GFM tables, code fences, KaTeX math and Mermaid diagrams all render in one consistent style — no mix of screenshots and live text.
  3. Check the preview and save. Diagrams render as inline SVG and the Markdown stays re-editable source on the page, so updating a diagram later is a one-line change.

Pasted diagrams render as centered inline SVG, and rendering libraries are bundled locally — nothing is pulled from a CDN, which matters for procurement checks on data boundaries.

Data Center note​

Mermaid Plus is Cloud-only today. If your team runs Confluence Data Center, dedicated DC apps (Stratus Add-ons' Mermaid Diagrams, weweave's Mermaid Charts) are the established options — this guide's Mermaid syntax applies everywhere, but the installation step differs.

Try Mermaid Plus Diagrams & AI Agent for Confluence

All 30 Mermaid diagram types plus a Rovo AI agent, with live preview and one-click templates — free for up to 10 users.

Get it on the Atlassian Marketplace