Flowchart

Show the steps and decisions in a process.

View Markdown

Edges on one side of a node

Two-way pair — An arrowhead and the edge that leaves beside it should not touch.Open in Playground
Two-way pairs in a triangleOpen in Playground
Diamond with an edge back to it — Three edges on the tip of the diamond, and one in and one out on top of F.Open in Playground
Decision with loopsOpen in Playground
TreeOpen in Playground
Fan out, 3Open in Playground
Fan out, 7 — More edges than the hub has room for, so they share a place.Open in Playground
Fan in, 3Open in Playground
Fan in, 7Open in Playground
Hub with edges both waysOpen in Playground
Parallel edgesOpen in Playground
Self-loops with other edgesOpen in Playground
Arrow types and line stylesOpen in Playground

Directions

TDOpen in Playground
BTOpen in Playground
LROpen in Playground
RLOpen in Playground

Shapes

Sheet 1, top to bottom — Every edge should end on the outline of its shape.Open in Playground
Sheet 2, top to bottomOpen in Playground
Sheet 3, top to bottomOpen in Playground
Sheet 4, top to bottomOpen in Playground
Sheet 5, top to bottomOpen in Playground
Sheet 6, top to bottomOpen in Playground
Sheet 1, left to rightOpen in Playground
Sheet 2, left to rightOpen in Playground
Sheet 3, left to rightOpen in Playground
Sheet 4, left to rightOpen in Playground
Sheet 5, left to rightOpen in Playground
Sheet 6, left to rightOpen in Playground

Subgraphs

Edges across and onto groups — An edge that ends on a group should not land where another edge passes through its border.Open in Playground
Two-way between groupsOpen in Playground
Nested groupsOpen in Playground
Groups with their own directionOpen in Playground
Group to group, both waysOpen in Playground

Wide and dense

Notes into two hubs — Long runs across the gap between two ranks.Open in Playground
Fan in, 30Open in Playground
Fan out, 30, left to rightOpen in Playground
Two dense ranksOpen in Playground
Chain with edges that skip ranksOpen in Playground
Short nodes beside a tall oneOpen in Playground
Wide rank over a narrow oneOpen in Playground

Labels

Labels on a fanOpen in Playground
Labels on a two-way pairOpen in Playground
Tall and wide nodesOpen in Playground

Curves

basisOpen in Playground
linearOpen in Playground
stepOpen in Playground
stepBeforeOpen in Playground
stepAfterOpen in Playground

Documentation examples

1. flowchart LR · idOpen in Playground
2. flowchart LR · id1[This is the text in the box]Open in Playground
3. flowchart LR · id["This ❤ Unicode"]Open in Playground
4. flowchart LR · markdown["`This **is** _Markdown_`"]Open in Playground
5. flowchart TD · Start --> StopOpen in Playground
6. flowchart LR · Start --> StopOpen in Playground
7. flowchart LR · subgraph ClientOpen in Playground
8. flowchart LR · subgraph ClientOpen in Playground
9. flowchart LR · id1(This is the text in the box)Open in Playground
10. flowchart LR · id1([This is the text in the box])Open in Playground
11. flowchart LR · id1[[This is the text in the box]]Open in Playground
12. flowchart LR · id1[(Database)]Open in Playground
13. flowchart LR · id1((This is the text in the circle))Open in Playground
14. flowchart LR · id1>This is the text in the box]Open in Playground
15. flowchart LR · id1{This is the text in the box}Open in Playground
16. flowchart LR · id1{{This is the text in the box}}Open in Playground
17. flowchart TD · id1[/This is the text in the box/]Open in Playground
18. flowchart TD · id1[\This is the text in the box\]Open in Playground
19. flowchart TD · A[/Christmas\]Open in Playground
20. flowchart TD · B[\Go shopping/]Open in Playground
21. flowchart TD · id1(((This is the text in the circle)))Open in Playground
22. flowchart RL · A@{ shape: manual-file, label: "File Handling"}Open in Playground
23. flowchart TD · A@{ shape: rect, label: "This is a process" }Open in Playground
24. flowchart TD · A@{ shape: rounded, label: "This is an event" }Open in Playground
25. flowchart TD · A@{ shape: stadium, label: "Terminal point" }Open in Playground
26. flowchart TD · A@{ shape: subproc, label: "This is a subprocess" }Open in Playground
27. flowchart TD · A@{ shape: cyl, label: "Database" }Open in Playground
28. flowchart TD · A@{ shape: circle, label: "Start" }Open in Playground
29. flowchart TD · A@{ shape: odd, label: "Odd shape" }Open in Playground
30. flowchart TD · A@{ shape: diamond, label: "Decision" }Open in Playground
31. flowchart TD · A@{ shape: hex, label: "Prepare conditional" }Open in Playground
32. flowchart TD · A@{ shape: lean-r, label: "Input/Output" }Open in Playground
33. flowchart TD · A@{ shape: lean-l, label: "Output/Input" }Open in Playground
34. flowchart TD · A@{ shape: datastore, label: "Datastore" }Open in Playground
35. flowchart TD · A@{ shape: trap-b, label: "Priority action" }Open in Playground
36. flowchart TD · A@{ shape: trap-t, label: "Manual operation" }Open in Playground
37. flowchart TD · A@{ shape: dbl-circ, label: "Stop" }Open in Playground
38. flowchart TD · A@{ shape: text, label: "This is a text block" }Open in Playground
39. flowchart TD · A@{ shape: notch-rect, label: "Card" }Open in Playground
40. flowchart TD · A@{ shape: lin-rect, label: "Lined process" }Open in Playground
41. flowchart TD · A@{ shape: sm-circ, label: "Small start" }Open in Playground
42. flowchart TD · A@{ shape: framed-circle, label: "Stop" }Open in Playground
43. flowchart TD · A@{ shape: fork, label: "Fork or Join" }Open in Playground
44. flowchart TD · A@{ shape: hourglass, label: "Collate" }Open in Playground
45. flowchart TD · A@{ shape: comment, label: "Comment" }Open in Playground
46. flowchart TD · A@{ shape: brace-r, label: "Comment" }Open in Playground
47. flowchart TD · A@{ shape: braces, label: "Comment" }Open in Playground
48. flowchart TD · A@{ shape: bolt, label: "Communication link" }Open in Playground
49. flowchart TD · A@{ shape: doc, label: "Document" }Open in Playground
50. flowchart TD · A@{ shape: delay, label: "Delay" }Open in Playground
51. flowchart TD · A@{ shape: das, label: "Direct access storage" }Open in Playground
52. flowchart TD · A@{ shape: lin-cyl, label: "Disk storage" }Open in Playground
53. flowchart TD · A@{ shape: curv-trap, label: "Display" }Open in Playground
54. flowchart TD · A@{ shape: div-rect, label: "Divided process" }Open in Playground
55. flowchart TD · A@{ shape: tri, label: "Extract" }Open in Playground
56. flowchart TD · A@{ shape: win-pane, label: "Internal storage" }Open in Playground
57. flowchart TD · A@{ shape: f-circ, label: "Junction" }Open in Playground
58. flowchart TD · A@{ shape: lin-doc, label: "Lined document" }Open in Playground
59. flowchart TD · A@{ shape: notch-pent, label: "Loop limit" }Open in Playground
60. flowchart TD · A@{ shape: flip-tri, label: "Manual file" }Open in Playground
61. flowchart TD · A@{ shape: sl-rect, label: "Manual input" }Open in Playground
62. flowchart TD · A@{ shape: docs, label: "Multiple documents" }Open in Playground
63. flowchart TD · A@{ shape: processes, label: "Multiple processes" }Open in Playground
64. flowchart TD · A@{ shape: flag, label: "Paper tape" }Open in Playground
65. flowchart TD · A@{ shape: bow-rect, label: "Stored data" }Open in Playground
66. flowchart TD · A@{ shape: cross-circ, label: "Summary" }Open in Playground
67. flowchart TD · A@{ shape: tag-doc, label: "Tagged document" }Open in Playground
68. flowchart TD · A@{ shape: tag-rect, label: "Tagged process" }Open in Playground
69. flowchart TD · A@{ icon: "fa:user", form: "square", label: "User Icon", pos: "t…Open in Playground
70. flowchart TD · A@{ img: "https://mermaid.js.org/favicon.svg", label: "My exampl…Open in Playground
71. flowchart LR · A-->BOpen in Playground
72. flowchart LR · A --- BOpen in Playground
73. flowchart LR · A-- This is the text! ---BOpen in Playground
74. flowchart LR · A---|This is the text|BOpen in Playground
75. flowchart LR · A-->|text|BOpen in Playground
76. flowchart LR · A-- text -->BOpen in Playground
77. flowchart LR · A-.->B;Open in Playground
78. flowchart LR · A-. text .-> BOpen in Playground
79. flowchart LR · A ==> BOpen in Playground
80. flowchart LR · A == text ==> BOpen in Playground
81. flowchart LR · A ~~~ BOpen in Playground
82. flowchart LR · A -- text --> B -- text2 --> COpen in Playground
83. flowchart LR · a --> b & c--> dOpen in Playground
84. flowchart TB · A & B--> C & DOpen in Playground
85. flowchart TB · A --> COpen in Playground
86. flowchart LR · A e1@--> BOpen in Playground
87. flowchart LR · A e1@==> BOpen in Playground
88. flowchart LR · A e1@--> BOpen in Playground
89. flowchart LR · A e1@--> BOpen in Playground
90. flowchart LR · A --o BOpen in Playground
91. flowchart LR · A --x BOpen in Playground
92. flowchart LR · A o--o BOpen in Playground
93. flowchart TD · A[Start] --> B{Is it?}Open in Playground
94. flowchart TD · A[Start] --> B{Is it?}Open in Playground
95. flowchart LR · id1["This is the (text) in the box"]Open in Playground
96. flowchart LR · A["A double quote:#quot;"] --> B["A dec char:#9829;"]Open in Playground
97. flowchart TB · c1-->a2Open in Playground
98. flowchart TB · c1-->a2Open in Playground
99. flowchart TB · c1-->a2Open in Playground
100. flowchart LR · subgraph TOPOpen in Playground
101. flowchart LR · subgraph subgraph1Open in Playground
102. flowchart TD · Start --> oneOpen in Playground
103. flowchart LR · subgraph "One"Open in Playground
104. flowchart LR · A-->BOpen in Playground
105. flowchart LR · A-->BOpen in Playground
106. flowchart LR · A -- text --> B -- text2 --> COpen in Playground
107. flowchart LR · A e1@==> BOpen in Playground
108. flowchart LR · id1(Start)-->id2(Stop)Open in Playground
109. flowchart LR · A:::someclass --> BOpen in Playground
110. flowchart LR · A:::foo & B:::bar --> C:::foobarOpen in Playground
111. flowchart LR · A:::myStyle --> BOpen in Playground
112. flowchart TD · B["fa:fa-twitter for peace"]Open in Playground
113. flowchart TD · B["fa:fa-twitter for peace"]Open in Playground
114. flowchart LR · A[Hard edge] -->|Link text| B(Round edge)Open in Playground