StatFAS › Alluvial and Sankey plot generator › Blog · Published 7 November 2026

Alluvial vs Sankey Diagram: Meaning, Differences and How to Create an Alluvial Sankey Plot Online

Short answer: an alluvial diagram follows the same observations across ordered categorical stages, while a classic Sankey diagram shows quantities flowing through a network of nodes. Both draw ribbons whose width is proportional to a count or amount, and many tools call the stage-based version an “alluvial Sankey style” flow diagram. You can create Sankey diagrams online from CSV or Excel data with the free StatFAS generator.

Create an alluvial Sankey plot online

What is an alluvial diagram? (alluvial diagram meaning)

An alluvial diagram, or alluvial plot, shows how a group of observations is distributed across categories at several stages and how it moves from one stage to the next. Each column (axis) is one categorical variable, each block is a category whose height equals its count, and each curved ribbon is the number of observations that go from a category in one stage to a category in the next. The name comes from the way river channels split and merge. The term was popularised for visualising change in networks by Rosvall and Bergstrom (2010).

What is a Sankey diagram?

A Sankey diagram is a flow diagram in which the width of each arrow or ribbon is proportional to the quantity flowing, such as energy, money, materials or users. It is named after Captain Matthew Sankey, who used it in 1898 to show the energy efficiency of a steam engine. Nodes can be placed anywhere, can have several inputs and outputs, and losses are usually drawn as separate branches.

Alluvial vs Sankey diagram: the difference

Alluvial diagramSankey diagram
Main ideaFollows the same observations across ordered stagesShows quantities flowing through a network
NodesCategories, stacked in one column per variableAny entities, placed freely
TotalsEvery stage adds up to the same NTotals can differ when flow is lost or added
Typical dataSurvey answers, customer journeys, progression over timeEnergy, budgets, material and money flows
Typical questionWhere do observations in category A end up?Where does the quantity go and how much is lost?

In practice the words are used interchangeably, and most online tools draw the stage-based version in “alluvial Sankey style”. If you search for sankey vs alluvial or alluvial plot vs sankey, the practical rule is: if your data are categorical variables measured on the same observations, you want an alluvial plot.

The same chart goes by many names: alluvial Sankey plot, alluvial Sankey style plot, Sankey alluvial flow diagram, or a Sankey diagram of an alluvial plot. They all describe ribbons that connect categories across stages with widths proportional to counts.

When to use an alluvial Sankey style flow diagram

Use it to see the main pathways and the biggest drop-offs: traffic source → interaction → engagement → purchase, student progression, survey responses at several time points, or patient pathways. The StatFAS example shows a Sankey diagram sample of 1,200 simulated website visitors, so you can view the result before you upload anything.

How to create an alluvial Sankey plot online (tutorial)

  1. Upload your data. Upload a CSV or Excel file, or press “Load example data” to see a Sankey diagram of website visitors immediately.
  2. Choose the stages. Tick 2 to 10 categorical columns and put them in order from left to right. Categorical columns are detected automatically.
  3. Set the counts and missing values. Optionally choose a count column if your rows are already aggregated. Decide whether rows with missing values are excluded or kept as a “Missing” category.
  4. Sort, filter and recolour. Sort categories by size, alphabetically or in a custom order, untick categories to filter them, and apply a colour scheme or pick colours.
  5. Style the figure. Change colours, font types and sizes, line widths, node width, spacing, ribbon opacity, labels, title and download resolution.
  6. Highlight flows. Hover for tooltips with source, destination and flow count. Click a block or ribbon to highlight every flow that passes through it.
  7. Compare two datasets or periods. Split the data by a column such as period, or upload a second file, to draw two diagrams on the same scale and test the differences.
  8. Read the tables and export. Use the flow percentages, conversion and drop-off rates, the most frequent pathways and the chi-square tests, then download PNG, SVG, PDF and CSV files.

Everything runs in your browser, so your data never leaves your device. Downloading PNG, SVG, PDF and CSV files requires you to be logged in on statfas.com.

What the tool reports

Block heights and ribbon widths share one scale, so they are exactly proportional to counts. The tables give the total number of observations, the frequency of every category at every stage, each flow as a percentage of the total, the conversion rate (flow ÷ source category) and drop-off rate, the ten most frequent pathways, and Pearson chi-square tests with Cramér’s V between consecutive stages. When you compare two datasets or periods, each flow’s share is compared with a two-proportion z test with Bonferroni adjustment.

Alluvial diagram in Python

Python has no built-in alluvial function, but Plotly’s go.Sankey can draw the same chart if you build the node and link lists yourself. This example takes a CSV with one row per visitor and four stage columns:

import pandas as pd
import plotly.graph_objects as go

df = pd.read_csv("visitors.csv")
stages = ["Traffic_Source", "Website_Interaction", "Engagement", "Final_Outcome"]

# one node per (stage, category)
labels = [f"{col}: {c}" for col in stages for c in df[col].dropna().unique()]
idx = {label: i for i, label in enumerate(labels)}

source, target, value = [], [], []
for a, b in zip(stages[:-1], stages[1:]):
    flows = df.groupby([a, b]).size().reset_index(name="n")
    for _, r in flows.iterrows():
        source.append(idx[f"{a}: {r[a]}"])
        target.append(idx[f"{b}: {r[b]}"])
        value.append(int(r["n"]))

fig = go.Figure(go.Sankey(node=dict(label=labels, pad=15, thickness=18),
                          link=dict(source=source, target=target, value=value)))
fig.write_html("sankey.html")   # or fig.show()

Plotly draws the diagram, but the code does not give you percentages, conversion, drop-off or tests; you would add those with further code. In R, the ggalluvial package serves the same purpose. The online tool does the aggregation and statistics for you.

Common mistakes

En français : diagramme alluvial Sankey

Un diagramme alluvial (ou diagramme de Sankey de type alluvial) montre comment des observations passent d’une catégorie à une autre à travers plusieurs étapes. La largeur de chaque ruban est proportionnelle à l’effectif. L’outil StatFAS permet de créer un diagramme alluvial Sankey en ligne à partir d’un fichier CSV ou Excel.

Frequently asked questions

What is the difference between an alluvial and a Sankey diagram?

Both draw flows as ribbons whose width is proportional to a quantity. An alluvial diagram follows the same observations across ordered categorical axes (stages), so every stage adds up to the same total. A Sankey diagram is a general flow diagram of quantities between nodes in a network; nodes can sit anywhere, branch and merge freely, and show losses as separate flows. Many tools say “alluvial Sankey style” for the stage-based version, which is what this generator draws.

What does an alluvial diagram mean and how do I read it?

Each column is one categorical variable (a stage), each block is a category and its height is the number of observations in it. Each curved ribbon is the number of observations that move from a category in one stage to a category in the next stage, and its width is proportional to that count.

Can I make an alluvial diagram in Python?

Yes. Python libraries such as Plotly can draw Sankey diagrams from lists of sources, targets and values, but you have to aggregate the data and compute any statistics yourself. This online tool does the aggregation, draws the alluvial Sankey plot and reports flow percentages, conversion, drop-off and chi-square tests without any code.

Is this alluvial Sankey plot generator free, and is my data private?

Creating and viewing diagrams is free. All processing happens in your browser, so your data never leaves your device. Downloading PNG, SVG, PDF and CSV files requires you to be signed up and logged in on statfas.com.

When should I use an alluvial Sankey style flow diagram?

Use it to follow groups of observations across stages, for example traffic source to website interaction to engagement to purchase, student progression, survey answers at different time points, or patient pathways. It shows where most observations go and where they drop off.

Que signifie diagramme alluvial Sankey ?

Un diagramme alluvial (ou diagramme de Sankey de type alluvial) montre comment des observations passent d’une catégorie à une autre à travers plusieurs étapes. La largeur de chaque ruban est proportionnelle à l’effectif.

References

Rosvall, M., & Bergstrom, C. T. (2010). Mapping change in large networks. PLoS ONE, 5(1), e8694.

Sankey, M. H. P. R. (1898). Introductory note on thermal efficiency of steam-engines. Minutes of the Proceedings of the Institution of Civil Engineers, 134, 278–283.

Shah, F. A. (2026). Alluvial and Sankey plot generator [Computer software]. StatFAS. https://statfas.com/alluvial-sankey-plot-generator.html

Create Sankey diagrams online