Sankey Charts Visualize How Quantities Flow Through Stages

What a Sankey chart is, how flow width encodes magnitude, when to use one over a funnel or stacked bar, and how to read one without over-reading the flows.

Overview

A Sankey chart is a flow diagram where the width of each arrow or link is proportional to the quantity of flow between two points. It visualizes how values move from source nodes through stages to destination nodes, making relative magnitude instantly visible. The terms “Sankey chart” and “Sankey diagram” are used interchangeably to refer to the same visualization technique.

The chart is named after Irish engineer Captain Matthew Henry Phineas Riall Sankey, who first illustrated energy flows with proportional arrows in 1898. Today, Sankey charts appear in energy analysis, supply chain tracking, customer journey mapping, budget allocation, and any scenario where understanding how quantities split, combine, or flow through stages matters more than precise numerical comparison alone.

How a Sankey chart works

A Sankey chart translates three core data elements—source, target, and value—into a visual representation where movement becomes instantly comparable. Understanding this structure helps you decide whether a Sankey chart fits your data and how to prepare inputs before building one.

Nodes, links, and flow values

In a Sankey chart, nodes are the categories, stages, or states you’re tracking. Links are the connections between them, and their width encodes a numeric value—quantity, volume, revenue, users, or any additive measure. Each row in your data represents one link: it specifies a source node, a target node, and a value that determines the width of the arrow connecting them.

Consider a simple example: tracking 1,000 website visitors from landing page to checkout.

Source Target Value
Landing Product Browse 800
Landing Exit 200
Product Browse Cart 600
Product Browse Exit 200
Cart Checkout 500
Cart Exit 100

Each row becomes one visible link in the chart. The landing page shows two outgoing arrows: a wide one (800 visitors) to Product Browse and a narrower one (200 visitors) to Exit. Readers immediately see that most visitors proceed but a fifth abandon at the first step. The width difference communicates magnitude faster than a number would.

Direction, stages, and width

Sankey charts flow left-to-right by default (though top-to-bottom and circular layouts exist). This directional flow encourages readers to follow the path from first to last stage, understanding both where volume goes and where it drops off. The width at any stage should equal the sum of incoming flows (conservation principle), though this can break down in real-world data with leakage or untracked transitions.

The visual width encodes only the flow magnitude, not area or any other dimension. A link twice as wide represents twice the quantity. However, small flows can become hard to see, and layout algorithms can emphasize some paths over others through node ordering or link routing, so cautious interpretation matters.

What Sankey charts are used for

Sankey charts excel when you need to show how a quantity splits across branches, recombines at later stages, or transitions between states in a way that highlighting the largest flows and identifying drop-offs or bottlenecks is the priority.

Business reporting examples

Marketing and operations teams use Sankey charts to track user funnels, showing where visitors drop out between landing, product page, cart, and checkout. Customer success teams map customer cohorts through lifecycle stages—trial, active, at-risk, churned—to visualize retention and attrition patterns. Finance uses Sankey charts to visualize budget allocation from departments down to projects, or revenue flows from sources through distribution channels. Inventory teams track product movement from warehouses through distribution centers to retail locations, surfacing imbalances or bottlenecks.

In each case, the chart reveals not just totals but the path: where do most visitors go, and where do they disproportionately drop off? This visual narrative is harder to extract from a table of numbers and impossible to see in a simple bar chart, which only shows totals per stage without the connecting flows.

Research and systems examples

Scientists and engineers use Sankey diagrams for material and energy flows, where conservation of mass or energy is a physical law. An energy balance for a country visualizes how primary energy (oil, gas, coal, renewables) flows through generation, transmission, and consumption, with losses visible as intermediate nodes. Epidemiologists track disease progression through disease stages or health states over time, surfacing where interventions have the most impact. Climate and sustainability researchers show carbon flows through economic sectors or the circular economy pathway from raw materials through production, use, and end-of-life treatment.

In research contexts, the Sankey diagram’s strength is making complex multi-path systems legible in a single view and surfacing conservation violations or missing flows that point to data quality issues.

How to read a Sankey chart

Reading a Sankey chart is straightforward once you know where to focus your attention. Start with the unit and total, then follow the largest flows, and finally inspect splits and recombinations before looking at small but important paths.

  1. Identify the unit and overall volume. Check the title and labels to confirm what is flowing (visitors, dollars, tons, patients) and the time period. Calculate or note the total quantity entering the first stage.

  2. Follow the largest flows first. Scan from left to right and identify the widest links. These represent the dominant paths through the system. A single wide path shows concentration; many equal paths show distribution. This quick pass gives you the system’s shape.

  3. Inspect splits and recombinations. At each stage, see how incoming volume splits into outgoing branches. Drops between stages reveal leakage or filtering. Recombinations (many sources feeding one target) reveal bottlenecks or merger points.

  4. Look for small but important paths. After surveying the main flows, examine narrow links. These often represent edge cases, exceptions, or risk-bearing minorities (e.g., small attrition, rare adverse events) that are easy to miss in aggregate data but important for decision-making.

  5. Check for conservation or reconciliation. In well-maintained charts, incoming width at a stage should equal outgoing width (minus any explicit loss node). If they don’t match, data quality issues or unmeasured flows may exist.

What you can infer

A Sankey chart reliably shows the relative magnitude of flows between stages, the largest and smallest paths, drop-off points where volume decreases, and recombination points where multiple sources converge. You can safely infer that a wide path is more prevalent than a narrow one and that a visible drop-off did occur in the observed data.

You can also infer the structure of the system—how many stages exist, how many branches are possible at each stage, and whether flows tend to concentrate or distribute. This visual summary is often the chart’s strongest use.

What you should not infer

Do not infer causation from sequence. A link from state A to state B shows that entities observed in state A later appeared in state B, but not why or how the transition happened. Sequence is not causation.

Do not assume complete coverage. The chart shows only entities and flows present in your data. Unmeasured, untracked, or missing flows are invisible. Churned users who stop reporting activity disappear without explanation. If the chart doesn’t show an explicit “lost” or “untracked” node, you don’t know whether the absence means zero outflow or missing data.

Do not attribute causation or intent to individuals. A user path from Landing → Browse → Exit does not mean the user intended to exit or that the product caused them to leave. It only shows their observed sequence.

Do not over-read small flows as proof of important phenomena. A narrow path is less prevalent, but the chart’s visual encoding makes it easy to miss subtle biases introduced by layout or color. Always verify findings against the underlying numbers.

Do not assume the chart is accurate or complete. If data is not validated, nodes can be mislabeled, duplicate flows can inflate totals, and missing stages can break conservation assumptions. Always check unit consistency and whether totals reconcile.

Sankey chart decision matrix

Sankey charts are powerful for specific scenarios but not universal. This matrix compares Sankey charts with six common alternatives to help you choose the right visualization.

Visualization Best Use Sankey Advantage Poor Fit Why Sankey Struggles
Sankey Chart Multiple stages, split/recombine flows, drop-off important Shows complete paths and splits in one view; proportional width is intuitive Linear single-path data; very high cardinality (many nodes); small datasets High visual complexity; needs training to read
Funnel Chart Linear progression, conversion focus Cleaner visual; easier to read stage-by-stage conversion rates Flows that recombine or backtrack; complex branching Cannot show splits back into earlier stages
Stacked Bar Chart Part-to-whole comparison across categories Simpler to read for static snapshots; fits on narrow space Flows between stages; drop-off patterns; recombination Hides the journey; shows totals, not movement
Flowchart Process logic, decision trees, system architecture Shows exact paths and decision nodes; no visual weight needed Quantitative comparison; which path is most common Ignores magnitude; not meant for large datasets
Alluvial Diagram Similar to Sankey but often with time as axis; cohort flows Highlights how categorical groups change over time Simple single-stage flows; non-time-series data Similar complexity; layout can hide flows
Chord Diagram Bidirectional flows, relationships between groups Shows mutual connections Directional flow; many-stage sequences; large values Harder to read; limited scalability
Treemap Hierarchical data, part-to-whole at multiple levels Fits large hierarchies in small space; nesting is clear Sequential flows; drop-offs; stage-to-stage movement No sense of direction or change

When a Sankey chart is a good choice

Choose a Sankey chart when all three conditions hold: (1) your data represents meaningful flow between defined stages or states, (2) multiple paths or splits exist and you want to highlight the largest ones, and (3) relative magnitude matters more than precision—you want readers to see that path A is twice as big as path B without requiring them to read exact numbers.

Examples: user journeys through signup → trial → active → churn; budget allocation from finance → departments → projects; product movement from manufacturing → warehouse → retail → consumer; patient progression through disease states.

Avoid Sankey charts for linear funnels where every user follows the same path, for datasets smaller than a few dozen records (overkill complexity), or for audiences who strongly prefer tables and will be frustrated by the learning curve.

When another chart is clearer

Use a funnel chart instead if you have a purely linear progression and conversion rates are what matter most—viewers will understand it immediately. Use a stacked bar chart if you need to compare part-to-whole ratios across many categories and flows between stages are not important. Use a flowchart if the logic of decision-making or process steps matters more than quantitative magnitude. Use a treemap if your data is hierarchical (parent-child relationships) rather than sequential (stage-to-stage flow).

Use a table or pivot table if your audience is analytically sophisticated and prefers exact numbers to visual approximation, or if the full precision of the data must be available for reference without interaction.

What data you need for a Sankey chart

Sankey charts require just three core fields per row: source, target, and value. Optional fields can enhance the chart with stage labels, categories, or confidence intervals, but the minimal dataset is simple and familiar to most analysts.

A simple source-target-value field layout

Prepare your data as a flat table with one row per link. Here’s a realistic example for tracking customer lifecycle over one month:

source_stage target_stage customer_count
Trial Active 450
Trial Churned 120
Trial On-Hold 30
Active Active 2800
Active Churned 180
Active On-Hold 120
On-Hold Active 40
On-Hold Churned 50
Churned Reactivated 25

Each row defines one flow: the source_stage and target_stage are node names, and customer_count is the width of the link. When you visualize this, you see Trial customers splitting into Active (dominant), Churned (minority), and On-Hold (small); Active customers mostly staying Active but some churning; and a small reactivation flow from Churned back to Active.

The source and target fields should contain consistent, non-null values. If you mix “Trial” and “trial” in the same dataset, they become two different nodes. Use lowercase, proper case, or acronyms consistently. Avoid spaces or special characters unless your chart tool handles them gracefully. The value field should be numeric and positive (no negative or null values, unless you explicitly model loss as a separate sink node).

Optional enhancements include a stage field (e.g., “Trial” is in stage 1, “Active” is in stage 2) to enforce left-to-right layout; a category field to color flows by type or source; or a unit label (e.g., “customers”, “dollars”, “tons”) to clarify magnitude.

Data checks before you publish

Before creating or sharing a Sankey chart, run through this checklist to catch common problems:

  • Unit consistency. All values in the value column should represent the same unit (customers, not a mix of customers and revenue). If units differ, create separate charts or add a “unit” column.
  • No duplicate paths. If your data has multiple rows for the same source-target pair, sum them into one row. Duplicates will either break the chart or invisibly distort flow widths.
  • Null or missing values. Remove or explicitly handle any row with missing source, target, or value. Most tools will skip or error on these.
  • Check for conservation. Sum the outgoing values from a stage; they should equal (or be less than, if there’s leakage) the incoming sum. Major imbalances signal data quality issues.
  • No cycles. If your data has a link that creates a loop (e.g., A → B → C → A), most Sankey renderers will struggle or fail. Cycles are possible in real systems (e.g., a user returning to trial after churn) but require special handling.
  • No negative values. Sankey assumes width is always positive. If you need to show reversals or refunds, either model them as a separate flow (e.g., “Refunded” as a target node) or split into two charts (forward and reverse flows).
  • High-cardinality check. Count distinct source and target nodes. Fewer than 10 per stage is clean; 10–20 is starting to crowd; above 30, a Sankey usually becomes unreadable and aggregation is necessary.
  • Total validation. Sum all incoming values to the first stage. If this doesn’t match your expectation (e.g., total customers for the month), investigate why.

Common Sankey chart mistakes

Sankey charts can mislead when data is incomplete, design choices emphasize certain flows over others, or readers misinterpret the visualization. Catching these mistakes before publishing prevents confusion.

Too many nodes or flows

When you have dozens of distinct sources or targets, a Sankey diagram becomes a hairball—links crossing, labels overlapping, and no clear path to follow. A viewer looking at 50 nodes and 200+ links has learned nothing.

The solution is aggregation or filtering. Group related nodes into categories (e.g., “Social Media” instead of listing TikTok, Instagram, Facebook separately) or filter to top N sources and lump the rest into “Other”. If you have 100 product SKUs flowing through distribution, show only top 10 by volume or group by product family. Accept that some detail will hide; a simpler, readable chart is better than an accurate but illegible one.

Non-conserved or missing flows

A Sankey chart assumes that total flow entering a stage equals total flow leaving (conservation). In reality, users churn, data collection gaps exist, and not all transitions are measured.

If 1,000 customers entered “Active” but only 950 left (to either “Churned” or stayed “Active”), where did the 50 go? Did they churn but not report? Did you lose track of them? A readable Sankey should have an explicit “Untracked” or “Lost” node to absorb unaccounted-for flow. Alternatively, if you know flow is missing (e.g., most users abandon without explicitly logging out), add that caveat in a footnote—do not leave the reader wondering why the totals don’t match.

Color and layout choices that change the story

The visual order and color of nodes and links shapes how readers interpret the chart. If you color all “Churned” paths red and they cluster on the left side of the chart, viewers may unconsciously think churn happens early. If you order nodes by size (largest flows at top), small flows become invisible at the bottom.

Be intentional about node ordering: do you want alphabetical, by volume, by stage, or by a business logic? Do you want to color by flow outcome (green for retention, red for churn) or by source (highlighting which channels leak most)? Make these choices explicitly and note them, especially if the visual order implies something you don’t want readers to assume.

Avoid overloading color encoding. Use color to highlight a single dimension (e.g., which channel a visitor came from, or whether they converted). Combining too many colors with width encoding creates cognitive overload and makes small flows even harder to spot.

How to create a Sankey chart

Creating a Sankey chart follows a standard workflow: prepare data, choose a tool path, build the chart, validate totals and labels, and publish or share.

  1. Prepare and validate data. Structure it as source-target-value, run the checks listed above, and export to CSV, XLSX, or your tool’s native format.

  2. Choose a tool path that fits your skills and constraints. See below for an overview of code, BI platform, and no-code routes.

  3. Build the chart. Load your data into the tool, map source/target/value fields, adjust node layout and colors, and render.

  4. Validate output. Spot-check that the largest flows visually match your expectations, totals reconcile or leakage is explicitly modeled, and labels are clear. If the chart is unreadable, consider aggregation or filtering as noted above.

  5. Label units and define scope. Add a subtitle or footnote that names the unit (e.g., “thousands of customers”), the time period (e.g., “January 2026”), and any data exclusions (e.g., “excludes refunds” or “includes estimated churn”).

  6. Share or embed. Depending on your tool, you can embed the chart in a web page, publish to a shareable link, download as an image, or export for use in presentations or reports. If sharing underlying data helps, include a link to the CSV or a data explorer.

Code-first, BI, and no-code paths

Python developers often use Plotly (with plotly.graph_objects.Sankey), which requires a list of source indices, target indices, and values, plus optional node labels and colors. The learning curve is low if you’re already familiar with Plotly, and customization is deep.

JavaScript developers can use Google Charts (via the google.charts.Sankey library), which requires loading the Google Charts library and passing data as a two-dimensional array with source, target, value columns. Google Charts handles layout automatically and provides hover interactivity.

BI platforms (Tableau, Looker, Power BI) typically offer Sankey as a built-in or plugin visualization. Data preparation is often simpler because the tool handles dimension-to-dimension flows automatically, though customization may be more limited.

Spreadsheet users (Excel, Google Sheets) have limited native Sankey support. You can use add-ons (e.g., Google Sheets plugins) or export to a tool. If your chart is simple and one-time, a no-code platform may be faster than learning a library.

No-code platforms like Flourish, RAWGraphs, or D3-based tools let you paste your CSV and configure the chart visually without writing code. These are ideal for one-off analyses and sharing, though interactivity and customization are pre-built.

Sharing the underlying dataset

If your goal is to publish both the chart and the raw data for downstream exploration, you can upload your source-target-value CSV to a dataset-sharing platform like TablePage to generate an interactive public page. TablePage lets you drag and drop CSV, TSV, XLSX, or XLS files and instantly creates a shareable dataset page with charts, a filterable table, and AI-powered insights—no signup required. This is useful when your reader audience benefits from diving into the raw numbers, running their own filters, or embedding the page in a larger report. The platform auto-generates bar charts, histograms, and scatter plots from your data; while Sankey-specific generation is not built-in, you can prepare your Sankey separately (using the code or BI paths above) and link both the interactive page and the Sankey visualization side by side for comprehensive coverage.

Sankey chart FAQ

Is there a difference between “Sankey chart” and “Sankey diagram”?

No, they are synonymous. “Sankey diagram” is the more formal term in academic and scientific literature, while “Sankey chart” is common in business and BI contexts. Use whichever fits your audience.

Can a Sankey chart show both percentages and totals at the same time?

Yes, but with care. You can label nodes with both absolute counts and percentages, or use hover tooltips to show both. However, do not encode percentages as link width—width should always represent the same unit (e.g., customers or dollars) across the entire chart. Mixing units in width encoding is a common mistake that misleads.

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

Excel and Sheets do not have built-in Sankey support. You can use third-party add-ons (e.g., Google Sheets plugins), but most are limited or experimental. Exporting to Python, a JavaScript library, or a no-code tool is usually faster and more reliable.

How many nodes or flows are too many for a Sankey chart?

A readable Sankey typically has 5–20 nodes per stage and 10–50 total links. Beyond that, aggregation or filtering becomes necessary. If you have 100+ distinct sources or destinations, the chart will likely be unreadable and a table, faceted bar charts, or a different visualization (like a treemap or alluvial diagram) may be clearer.

Can I use a Sankey chart to show flows across multiple time periods?

Yes, but it requires careful design. Some tools support layered or animated Sankey charts where each time step is a separate chart. Alternatively, you can add a “time” or “period” column to your data and create separate Sankey charts side by side for easy comparison. Be cautious with animations—they can hide flows and make it hard for readers to spot changes.

What if my data has feedback loops (e.g., users returning to an earlier stage)?

Sankey charts assume left-to-right flow and do not handle cycles gracefully. If cycles are small and rare, you can ignore them (model it as “reactivation” flowing forward). If cycles are significant (e.g., many users try, fail, and retry), consider a different visualization or split the Sankey into multiple stages that capture re-entry explicitly.

How do I know if my Sankey chart is misleading?

Check three things: (1) Do totals at each stage reconcile, or is missing flow explained? (2) Does the visual emphasis on largest flows match your data (or have layout/color choices distorted the story)? (3) Am I implying causation from sequence, or am I careful to say “observed transition” instead? If you can answer yes to all three, the chart is likely honest and clear.

Drop to create a new dataset CSV, TSV, or Excel
Uploading...

Upload your own dataset

Explore any CSV with AI insights, charts & filters. Free, no account needed.