Mermaid for

Sankey diagrams

Show where everything flows

Visualize how budgets, users, energy, or traffic move and split across a system, with each flow drawn to scale.

What is a Sankey diagram?

A Sankey diagram shows how a quantity flows from one set of nodes to another. Each link is drawn as a band whose width is proportional to its value, so the largest flows and the biggest losses are visible at a glance.

The format is named after Matthew Henry Phineas Riall Sankey, an Irish engineer who used it in 1898 to show the energy efficiency of a steam engine. It is now common in energy analysis, finance, operations, and product analytics. In Mermaid, a Sankey diagram is written as CSV: each line is a source, a target, and a value. You can paste rows from a spreadsheet and Mermaid draws the diagram.

What you can map
with a Sankey diagram

User funnel and conversion analysis

Energy and resource flow visualization

Budget allocation and spend tracking

Traffic and referral source breakdowns

Supply chain and material flow

Revenue by segment or channel

Data pipeline volume tracking

User funnel and conversion analysis

Energy and resource flow visualization

Budget allocation and spend tracking

Traffic and referral source breakdowns

Supply chain and material flow

Revenue by segment or channel

Data pipeline volume tracking

Who uses Sankey diagrams
on Mermaid

Data Analysts

Show how values flow and distribute across categories in a format that communicates magnitude at a glance.

Business Analysts

Map where resources, budget, or users go, and where the largest drop-offs happen.

Startup Founders

Show your conversion funnel, revenue breakdown, or cost structure in a way investors can read quickly.

Consultants

Show clients where value is being created or lost across a process.

Project Managers

Track how effort or budget is being split across teams and workstreams.

When a Sankey diagram is
the right call

Traffic by source flowing into signups, trials, and paid conversions — showing drop-off at each stage.

Total budget flowing into headcount, infrastructure, marketing, and operations — with sub-breakdowns per category.

Total energy input distributed across heating, cooling, lighting, and equipment — with waste flows included.

Gross revenue flowing through direct, partner, and self-serve channels into each customer segment.

Less time syncing, more time building

One shared canvas for mapping ideas, collaborating live, and keeping teams on the same page, literally.

FAQ

Common questions about building Sankey diagrams in Mermaid.

A Sankey diagram is a flow diagram where the width of each link is proportional to the quantity it represents. It shows how a total splits, merges, and moves between stages.
Use one when the question is "where does it go, and how much?" Common uses are conversion funnels, budget allocation, energy balances, traffic sources, and supply chains. If you only need the shares of a single total, a pie chart is simpler.
A flowchart shows the steps and decisions in a process, and every arrow looks the same. In a Sankey diagram, each link’s width carries data. Use a flowchart for logic and a Sankey diagram for volume.
Start with the sankey keyword, then add one row per flow in the format source,target,value, for example Organic search,Signup,1200. Mermaid creates the nodes from the names you use. Wrap any label that contains a comma in double quotes. Flows must move in one direction,
FAQ Icon