Signup funnel
Each line is one hop and its count. Visits splits into Signup and Bounce, then Signup splits again.
sankey-beta
Visits,Signup,40
Visits,Bounce,60
Signup,Paid,15
Signup,Free,25A Sankey diagram shows how a quantity splits. The width of each band is the value you write on that line.
Copy an example, or open it in the live editor with this diagram already loaded.
Each line is one hop and its count. Visits splits into Signup and Bounce, then Signup splits again.
sankey-beta
Visits,Signup,40
Visits,Bounce,60
Signup,Paid,15
Signup,Free,25A single source splits into teams. The numbers are the weights, so they can be dollars or percentages.
sankey-beta
Budget,Engineering,50
Budget,Support,20
Budget,Marketing,18
Budget,Operations,12Two sources feed one node, and that node splits again. A node may have any number of inputs and outputs.
sankey-beta
Search,Docs,30
Social,Docs,10
Docs,Editor,28
Docs,Exit,12A Mermaid Sankey diagram is a list of weighted flows. After sankey-beta, each line is Source,Target,Value. The value sets the thickness of the band from source to target. A node can have several incoming and outgoing lines; Mermaid stacks them. Quote a name that contains a comma. There is no axis and no time. Use a Sankey when the question is where a quantity goes. Use a flowchart when the question is what happens next.
Use a Sankey for funnels, energy splits, budget allocation, and traffic that divides across pages. Use a pie chart when each part is a share of one whole and nothing flows onward. Use an XY chart for a series of measurements.
Edit this sankey diagram in the live editor, read the Mermaid cheat sheet, or compare it with Flowchart, Pie Chart and Mind Map.
| Element | Syntax | Description |
|---|---|---|
| Flow | Source,Target,Value | Define a flow between nodes |
| Quoted names | 'Node Name',Target,10 | Use quotes for names with spaces |
| Multiple flows | One per line | Each line defines a flow |
Putting spaces around the idea of a header, or adding Source,Target,Value as a first row.
Do not add a header. The first data line is a real flow, and a header would become a node named Source.
Using a comma inside an unquoted node name.
The comma is the field separator. Rename the node or quote it so the line still has three fields.
Choosing a Sankey when nothing is actually flowing onward.
A single split with no second hop is usually clearer as a pie chart.
Sankey diagrams are wide. SVG keeps the bands clean at large sizes. Free PNG exports include a watermark.
High-resolution images for documents and presentations.
Scalable vectors for web and further editing.
Print-ready format for professional documentation.
Got Mermaid code from ChatGPT? Paste it here to render and export instantly.
All 21 diagram types in one PDF reference.
Open the editor with this example pre-loaded and start customizing.
Sankey diagram showing data volume flowing through a real-time streaming pipeline from producers through processing to consumers.
Sankey diagram visualizing user flow through a SaaS conversion funnel from landing page through signup, activation, and subscription.