Skip to content

Sankey Diagram Maker

Type each flow as Source -> Target: value and get a Sankey diagram: boxes in ordered columns, joined by ribbons whose widths are exactly proportional to the amounts they carry. Nothing overlaps, labels can show the amounts, and you can download the diagram as SVG or PNG. Free, no sign-up, and your numbers never leave your browser.

Write Wages -> Household income: 3400. The arrow can be ->, → or =>, and the SankeyMATIC form Wages [3400] Household income works too. Repeat lines add up. Start a line with # for a comment. Each name is one box wherever it appears; a flow that would loop back is left out.

15 boxes · 14 flows · 4 columns

Order of the boxes in each column
Color the ribbons by
Monthly Household Budget (USD)Sankey diagram with 15 boxes and 14 flows across 4 columns. The largest flow is Wages to Household income, 3,400.Monthly Household Budget (USD)Wages 3,400Household income 4,200Benefits 300Side work 500Housing 1,500Food 700Transport 450Savings 600Other 950Rent 1,250Utilities 250Groceries 560Eating out 140Fuel 220Public transit 230
Show the flows as a table
FromToAmount
WagesHousehold income3,400
BenefitsHousehold income300
Side workHousehold income500
Household incomeHousing1,500
Household incomeFood700
Household incomeTransport450
Household incomeSavings600
Household incomeOther950
HousingRent1,250
HousingUtilities250
FoodGroceries560
FoodEating out140
TransportFuel220
TransportPublic transit230

Title and figure style

Color of the first box (the rest follow in order)

Takes the title out of the image and sets the figure number in bold and the title in italics above it — the APA 7 layout.

How to Use the Sankey Diagram Maker

  1. 1. List the flows. Write one flow per line as Source -> Target: value. A name is one box wherever it appears, so Housing as a target and as a source is the same box.
  2. 2. Chain them. A flow's target can be the source of the next, so money, energy or people can pass through several stages. Repeat lines for the same pair add up.
  3. 3. Check the notices. Lines that cannot be drawn are left out with a reason: a missing value, a flow to itself, or a flow that would loop back. Boxes that take in and send out different amounts are listed too.
  4. 4. Adjust the look. Choose how boxes are ordered in each column, whether ribbons take their source's or target's color, whether labels show amounts, and a unit to print after them.
  5. 5. Download. Take the SVG or PNG. With APA style figure on, the figure number and title go above the image and an optional note goes below.

The Input Syntax

You writeIt means
Wages -> Income: 3400A flow of 3400 from Wages to Income
Wages → Income: 3400 or Wages => Income: 3400The same; any of the three arrows
Wages [3400] IncomeThe same, in the SankeyMATIC style
# Monthly budgetA comment, ignored (so is a line starting with //)

Values must be above zero. A decimal comma works where your keyboard uses one, but type amounts without thousands separators — a lone comma is read as the decimal mark. Up to 40 boxes and 100 flows are drawn.

How the Diagram Is Built

Each box goes in the column after the longest chain of flows that leads to it, and boxes that only receive flow are moved to the last column so every path ends at the right-hand edge. Ribbon width is the flow multiplied by one scale for the whole diagram, chosen so the fullest column fits the height. A ribbon of 500 is therefore twice as wide as a ribbon of 250, in any column. Boxes start in the order they first appear in your list, and Reduce crossings then reorders each column using the average position of the boxes it connects to. The result is the same every time for the same text.

Flows and what they draw

Wages -> Household income: 3400
Benefits -> Household income: 300
Household income -> Housing: 1500
Household income -> Savings: 2200

Wages and Benefits form the first column, Household income the second, and Housing and Savings the third. Household income takes in 3700 and sends out 3700, so it balances. The figures are invented for illustration.

Reading and Writing About a Sankey Diagram

Sankey diagrams are named after Captain Matthew Sankey, who used one in 1898 to show how much of a steam engine's energy was useful and how much was lost. They suit any quantity that is split and combined — energy, money, materials, people moving between stages. They are poor at comparing many small flows, because thin ribbons are hard to tell apart; the table under the image gives the exact figures, and in a paper you should say what the unit is and what period or place the data covers.

  • Say what is measured. Put the unit in the title or the unit field, and the period in the title or the figure note.
  • Keep flows conserved. A box that takes in 100 and sends out 80 has lost 20 somewhere; add an explicit loss flow so the diagram balances.
  • Keep it readable. Past about 25 flows, group the small ones into an Other box and give the details in a table.

Frequently Asked Questions

What is a Sankey diagram?
A Sankey diagram is a flow diagram in which the width of each ribbon is proportional to the quantity it carries. Boxes (nodes) stand for stages, categories or places, and the ribbons show how much moves between them. It is used for energy, money, materials and similar flows.
How do I make a Sankey diagram from a list?
Write each flow on its own line as Source -> Target: value, for example Wages -> Income: 3400. The diagram redraws as you type. Flows whose target is another flow's source are chained into further columns automatically.
Why was a flow left out of my diagram?
The tool leaves out a line it cannot draw and tells you why: the line is not in the Source -> Target: value form, the value is missing or not above zero, a box flows to itself, or the flow would loop back to an earlier box. A Sankey diagram flows in one direction.
Why do some boxes show flow in and out that differ?
Real data often loses or gains an amount along the way — heat lost, a rounding gap, income not listed. The box is drawn as tall as the larger side, and the page lists such boxes. If you want the diagram to balance, add a flow to a Loss or Other box.
Can I choose which column a box goes in?
Not directly. A box sits one column after the longest chain of flows leading to it, and boxes with no outgoing flows go to the last column. To move a box, change the flows — for example, route it through an extra stage.
Can I put a Sankey diagram in an APA paper?
Yes, as a figure. Turn on APA style figure to set the figure number and title above the image and an optional note below. Say in the note what the units are and where the data came from, and cite the source of any data you did not collect yourself.

Related Tools

More in Charts & Diagrams

See all Charts & Diagrams