All diagram types Open editor

merIDK / Diagram types / Sankey diagram

Mermaid Sankey diagram: example and syntax

Sankey diagrams show flows between stages, with each band as wide as the amount it carries. Use them for budgets, energy use, traffic sources and funnels.

Open this example in the editor

Example code

sankey-beta
Salary,Rent,1200
Salary,Food,450
Salary,Savings,600
Salary,Fun,250
Savings,Index fund,400
Savings,Emergency,200

Result

sankey-beta
Salary,Rent,1200
Salary,Food,450
Salary,Savings,600
Salary,Fun,250
Savings,Index fund,400
Savings,Emergency,200

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types