Data visualization

Sankey Charts: What They Are, When to Use One, and How to Read It

A Sankey chart shows how a total flows between stages, with band width showing quantity. Learn when to use one, how to read it step by step, the mistakes to avoid, and when another chart works better.

A Sankey chart shows how a total flows from one stage to the next. Each band is a path, and its width is how much moves along it. That makes it the clearest way to answer “where does it all go?”, whether “it” is website visitors, budget, or energy.

This guide covers what a Sankey chart is, when to use one, how to read one step by step, the most common mistakes, and when a different chart works better. The example uses 1,000 website visitors, and you can download the data at the end.

tl;dr

Sankey chart

A flow diagram where band width shows how much moves from one stage to the next.

Use it when
You need to show where a total goes, and where it is lost.
Avoid it when
Flows loop back, there is only one path, or exact values matter most.
Best alternative
A funnel for a single path, a table for exact values.

Prefer to watch? The video covers the same ground in about two minutes.

Sankey charts, explained

What is a Sankey chart?

A Sankey chart (also called a Sankey diagram) has two parts:

  • Nodes are the bars. Each one is a group or a stage, such as a traffic source, a page, or an outcome. Its height is its total.
  • Bands (also called links or flows) connect the nodes. A band’s width is the amount moving from one node to the next.

Nothing is lost or invented between stages. What flows into a node equals what flows out of it, so the totals reconcile from left to right. That rule is what makes a Sankey chart trustworthy, and it’s the first thing to check when one looks wrong.

The chart is named after Matthew Henry Phineas Riall Sankey, an engineer who used one in 1898 to show how much of a steam engine’s energy became useful work and how much was lost as heat.

Why and when to use a Sankey chart

A table lists the numbers. A Sankey chart shows where they go. Reports often split one journey across three disconnected tables (traffic by channel, visits by landing page, conversions by page). A Sankey puts the whole path in one view, so the reader sees the connections instead of rebuilding them.

Use a Sankey chart to show:

  • How a total splits into paths, such as visits by source and landing page, or a budget by team and project.
  • What survives each stage of a process, such as leads becoming opportunities and then customers.
  • Where things get lost along the way, so the biggest leak is the widest band heading to “Left.”

It works best with two to four stages and a handful of nodes in each. For more chart types and when each one fits, see the SEO data visualization guide.

Example: where 1,000 visitors go

Here are 1,000 visits to a website in one month, followed from traffic source, to the first page they saw, to whether they signed up. Hover a band to see its value, or open “View the data” for the full table.

Pricing gets fewer visitors than the Blog but produces the most sign-ups

1,000 visits: traffic source → landing page → outcome

Sankey chart of 1,000 visitors flowing from four traffic sources (Search 520, Social 180, Direct 160, Email 140) to three landing pages (Blog 460, Home 280, Pricing 260), then to Signed up (250) or Left (750). The band from Pricing to Signed up, 140 visitors, is highlighted in orange.

Loading chart…

Example data

View the data
FromToVisitors
SearchBlog320
SearchPricing120
SearchHome80
SocialBlog140
SocialHome40
EmailPricing90
EmailHome50
DirectHome110
DirectPricing50
BlogSigned up60
BlogLeft400
PricingSigned up140
PricingLeft120
HomeSigned up50
HomeLeft230

The numbers are example data, chosen to show a pattern that’s common in real reports: the page with the most traffic isn’t the page that converts.

How to read a Sankey chart

Read it in four steps, left to right.

  1. Start on the left. Each node is a source, sized by its total. Search is the biggest at 520 visits, more than half the total.
  2. Follow the widest band. Width is quantity, so the widest band is the biggest flow. Here it’s the 400 visitors who landed on the Blog and left.
  3. Compare what goes in with what comes out. Pricing gets 260 visitors, fewer than the Blog’s 460, but 140 of them sign up. That’s 54%, against 13% for the Blog and 18% for Home.
  4. Finish on the right. The outcome nodes add up to the total: 250 signed up and 750 left.

The takeaway writes itself: Pricing is the best-converting page, so sending more of the Blog’s 460 visitors there (with links or calls to action) is likely worth more than growing Blog traffic further. That’s the kind of decision a Sankey chart supports and three separate tables hide.

The most common mistake: color everywhere, focus nowhere

Most Sankey charts that fail have too many flows and too many colors. Turn on the toggle below to see the same data the way it often gets charted: eight tiny extra sources and a different color for every band. Then turn it off again.

One color for the flow that matters beats a color for every flow

Same flows; the cluttered version adds eight sources of 21 visits each

Try it
Two versions of the same Sankey chart. The clean version shows 15 grey bands with the Pricing to Signed up band in orange. The cluttered version adds eight tiny sources, 23 bands in all, each a different color, so no single path stands out.

Loading chart…

Example data

View the data
FromToVisitors
SearchBlog320
SearchPricing120
SearchHome80
SocialBlog140
SocialHome40
EmailPricing90
EmailHome50
DirectHome110
DirectPricing50
BlogSigned up60
BlogLeft400
PricingSigned up140
PricingLeft120
HomeSigned up50
HomeLeft230

The cluttered version has 23 bands in eight colors, and nothing stands out, so the reader has to work out the story alone. The clean version is grey with one orange band, and the story is found in seconds: Pricing converts.

Other mistakes to avoid

  • A different color for every flow. Color should carry meaning. Use one neutral color, and save a bright one for the flow you want people to notice.
  • Dozens of thin bands nobody can follow. Group small sources into an “Other” node. Four referral sources of 21 visits each say more as one “Other · 84” node.
  • Nodes in random order, so bands cross. Order nodes so the biggest flows run as straight as possible. Crossings make readers trace bands by hand.
  • Totals that don’t reconcile. Every stage should add up to the same total. If it doesn’t, the chart is wrong, not just ugly.
  • No numbers on the nodes. Widths show proportion, not value. Add the total to each node’s label, as in the example above.

When not to use a Sankey chart

A Sankey chart is the wrong choice when:

  • Flows loop back. If items return to an earlier stage (visitors going back and forth between pages), use a network diagram or a path analysis instead.
  • There’s only one path. If everyone moves through the same steps in order, a funnel chart is simpler.
  • Exact values matter. Readers judge width poorly. If they need to compare 140 with 120, use a table or a bar chart.
  • You need to show change over time. A Sankey is a snapshot. Use a line chart for trends.
  • You have more than about eight nodes per column. It turns into spaghetti. Split it into two charts or group the small nodes.

How to make a Sankey chart

Every Sankey tool needs the same table with three columns: where the flow starts, where it ends, and how much moves. That’s the format of the example dataset.

SankeyMATIC

SankeyMATIC is free and runs in the browser. Type one flow per line, with the amount in brackets, and the chart draws as you type:

text
Search [320] Blog
Search [120] Pricing
Search [80] Home
Pricing [140] Signed up
Pricing [120] Left

Flourish or RAWGraphs

Both are free, no-code tools. Paste the three columns into a new Sankey chart (Flourish) or a Sankey diagram (RAWGraphs), map the columns to source, target, and value, and export an image or embed code.

Python

Plotly’s Sankey takes node labels plus three lists for the links: source and target (as positions in the label list) and value.

python
import pandas as pd
import plotly.graph_objects as go

df = pd.read_csv("sankey-example-visitors.csv")
labels = list(dict.fromkeys(df["from"].tolist() + df["to"].tolist()))
index = {label: i for i, label in enumerate(labels)}

fig = go.Figure(go.Sankey(
    node=dict(label=labels),
    link=dict(
        source=df["from"].map(index),
        target=df["to"].map(index),
        value=df["visitors"],
    ),
))
fig.show()

Chart.js

The charts on this page use Chart.js with the chartjs-chart-sankey plugin. Each flow is an object with from, to, and flow:

js
new Chart(canvas, {
  type: 'sankey',
  data: {
    datasets: [{
      data: [
        { from: 'Search', to: 'Blog', flow: 320 },
        { from: 'Pricing', to: 'Signed up', flow: 140 },
      ],
      colorFrom: '#33547e',
      colorTo: '#33547e',
    }],
  },
});

free download

Example dataset: 1,000 visitors, source to outcome

The 15 flows used in the charts above, in the from, to, value format every Sankey tool accepts.

Recap

  • A Sankey chart shows how a total flows between stages.
  • Band width is quantity, and every stage adds up to the same total.
  • Read it left to right: sources, paths, outcomes.
  • Keep it to a few flows and one highlight, and add the totals to the node labels.
  • Use a funnel for a single path, a table for exact values, and a line chart for trends.

Next in the Chart by Chart series: radar charts.

Common questions

Frequently asked questions

What is a Sankey chart used for?

A Sankey chart shows how a total moves between stages: where traffic comes from and where it lands, how a budget splits across teams, or how energy is used and lost. Use one when the story is where the volume goes, not just how big each stage is.

What is the difference between a Sankey chart and a funnel chart?

A funnel shows one path and how many drop out at each step. A Sankey shows many paths at once: items can split, merge, and end in different places. If everyone moves through the same steps in the same order, a funnel is simpler to read.

How many nodes can a Sankey chart have?

Keep it to about eight nodes per column and a few dozen flows at most. Past that, the bands get too thin to follow. Group small sources into an "Other" node, or split the chart in two.

Can I make a Sankey chart in Google Sheets or GA4?

Neither has a built-in Sankey chart. Export a table with three columns (from, to, value) and paste it into a free tool such as SankeyMATIC, Flourish, or RAWGraphs, or build it in Python with Plotly.

Who invented the Sankey chart?

It is named after Matthew Henry Phineas Riall Sankey, an Irish engineer who used one in 1898 to show the energy efficiency of a steam engine.