How to make a sankey diagram
- Enter one flow per row: Source, Target and Value. Nodes are created from the names you type.
- Chain flows by reusing names: “Salary → Budget” and then “Budget → Housing” creates a two-stage diagram.
- Spell node names consistently, because “Budget” and “budget ” are the same node, but “Budgets” is a different one.
- Adjust node alignment, width and spacing, and choose link colors in Customize.
- Download your diagram.
Data format
| Column | Type | Notes |
|---|---|---|
| Source | Text | Required |
| Target | Text | Required |
| Value | Number (zero or positive) | Required |
Up to 500 rows. One row per flow: where it comes from, where it goes and how much. Nodes are created from the names you type, so spell them consistently. Link width is proportional to value. Flows cannot loop back (A → B → A).
Customization options
- Node alignment: justify, left, right or center.
- Node width and spacing.
- Link colors: by source, by target, a source-to-target gradient, or neutral gray, with adjustable opacity.
- Node totals in labels.
- Per-node colors in the Colors section.
Downloading and exporting
- PNG: best for slides, documents and the web. It supports transparent backgrounds, and you can choose standard, 2×, 4× or slide-sized (1920 × 1080) output.
- JPEG: a smaller file with a solid background.
- SVG: a true vector file. It stays sharp at any size and can be edited in Illustrator, Inkscape or Figma.
- PDF: vector PDF sized to the chart, A4 or US Letter. If your labels use characters outside the standard PDF fonts (for example Chinese, Arabic or emoji), the PDF uses a high-resolution image instead and tells you.
- CSV and .json: your data, or the whole chart with its settings, to re-open later.
When to use a sankey diagram
- Budgets and cash flows: income sources → spending categories.
- Energy and material flows.
- User journeys: landing page → next page → conversion.
When to choose a different chart
- A simple sequential drop-off. A funnel chart is easier to read.
- The flows contain loops (A → B → A). Sankey diagrams require one-directional flows, and the tool tells you where the loop is.
- Hierarchical parts of a whole without flows. Use a treemap.
Common mistakes to avoid
Inconsistent node names
Typos create separate nodes. Check the node list in the data table under the chart.
Unbalanced nodes
If a node sends out more than it receives, the tool warns you. This usually means a missing inflow row.
Too many small flows
Dozens of thin links become noise. Group small destinations into “Other”.
Practical examples
Household money flow
Salary and freelance income into a budget, split into housing, food, transport, savings and more, with savings split again.
Website journeys
Traffic sources → landing pages → sign-up or exit.
Energy balance
Primary sources → conversion → end uses and losses.
How the layout works
The diagram uses the d3-sankey layout. Nodes are placed in columns by their depth in the flow, ordered vertically to reduce link crossings, and sized by the larger of their total inflow and outflow. Link width is exactly proportional to value, so a flow of 1,600 is twice as wide as a flow of 800. Before drawing, the tool runs a cycle check. If your flows loop back on themselves, it names the loop instead of drawing a broken diagram.
Frequently asked questions
What data format does a Sankey diagram need?
Three columns: Source, Target and Value, with one row per flow.
Can I have multiple stages?
Yes. Any target can also be a source for further flows. There is no limit on the number of stages.
Why does it say my flows form a loop?
A Sankey layout needs flows in one direction. Rename one of the nodes (for example “Budget (start)” and “Budget (end)”) to break the loop.
Can I color links by destination?
Yes. Set Link color to “Match target node”, or use a gradient.
How many flows can I add?
Up to 500 rows.
Your data stays private
Charts are drawn by your browser. Your data isn’t uploaded to our servers; it is kept only in this browser’s storage, for autosave and saved charts, until you clear it. See our privacy policy.