Mermaid diagram types

Mermaid turns short text descriptions into diagrams. Each guide below explains what the diagram is for, shows a working example you can open in TryMermaid, and lists the syntax you need.

Which Mermaid diagram should I use?

Start from what you want to show. Every diagram type works in the TryMermaid code editor with a live preview, and flowcharts can also be edited on the visual canvas.

If you want to…UseMermaid keyword
Show the steps and decisions in a processFlowchartflowchart TD
Show messages between users, services or APIs over timeSequence diagramsequenceDiagram
Model classes in code and how they relateClass diagramclassDiagram
Design database tables and their relationshipsER diagramerDiagram
Describe the states of something and what changes themState diagramstateDiagram-v2
Brainstorm or outline ideas around one topicMind mapmindmap
Schedule tasks with dates and dependenciesGantt chartgantt
List events in chronological orderTimelinetimeline
Show how a total splits into partsPie chartpie title Where the marketing budget went
Explain a branching and release strategyGit graphgitGraph
Show how each step of an experience feelsUser journeyjourney
Compare items on two axes to decide priorityQuadrant chartquadrantChart
Show how a quantity flows and where it is lostSankey diagramsankey-beta
Plot values over a scale as bars or a lineXY chartxychart-beta
Lay out components on a grid you controlBlock diagramblock-beta
Document the bit layout of a binary formatPacket diagrampacket-beta
Trace requirements to what satisfies and verifies themRequirement diagramrequirementDiagram
Describe software architecture at one level of detailC4 diagramC4Context