Home / Project Management Tools / Sankey diagram

Sankey diagram generator

Paste your flows one per line — Income [4200] Rent — and the diagram draws itself, with band widths proportional to each value. Color, calculated flows, unit labels, SVG and PNG export. Nothing leaves your browser.

Input6 flows
    Diagram options

    Margins hold the labels and keep fat columns off the edge. Canvas size stays Width × Height; give the left or right margin 80px or more and that column's labels move out into it.

    Diagram
    Cash reserves → Q4 budget: $185000Q4 budget → Payroll: $62000Q4 budget → Contractors: $38000Q4 budget → Infrastructure: $24000Q4 budget → Marketing: $21000Q4 budget → Unallocated reserve: $40000Cash reserves: $185000Q4 budget: $185000Payroll: $62000Contractors: $38000Infrastructure: $24000Marketing: $21000Unallocated reserve: $40000Cash reserves: $185000Q4 budget: $185000Payroll: $62000Contractors: $38000Infrastructure: $24000Marketing: $21000Unallocated reserve: $40000

    Example: a project budget split across payroll, contractors, infrastructure, marketing and reserve.

    Click the diagram or press Ctrl+Enter to redraw. Your input is saved in this browser only.

    How the input language works

    Each line is one flow: a source node, an amount in square brackets, and a target node. Names are case-sensitive, so Team and team are two different nodes. Anything after // is a comment, and blank lines are ignored, so you can group a long list into sections.

    Write thisAnd you get
    Income [4200] RentA flow of 4,200 from Income to Rent, in the default color.
    Income [4200] Rent #c0392bThe same flow, colored red.
    Income [4200] Rent #c0392b.7Red at 70% opacity instead of the default 45%.
    :Payroll #1d5a4bSets the Payroll node's color. Add >> to paint flows leaving it, << for flows arriving, or both.
    Budget [*] ReserveWhatever the source has left over — everything flowing into Budget that no other outgoing flow already claims.
    Contractors [?] BudgetWhatever the target still needs — the shortfall between its outgoing total and the other incoming flows.

    The [*] and [?] shorthands are the reason this generator is useful for planning rather than just drawing: you can fix the totals that matter and let the leftovers fall out. Both are resolved to a real number before anything is drawn, so the totals in the labels always add up.

    A worked project example

    A quarter of engineering capacity, split by intent:

    Engineering capacity [520] Feature work
    Engineering capacity [180] Platform and debt
    Engineering capacity [90] Support and bugs
    Engineering capacity [210] Overhead
    Feature work [300] Committed roadmap
    Feature work [220] Unplanned requests
    Overhead [120] Meetings
    Overhead [90] Context switching

    Load it and the widths read straight across: feature work takes 520 of the 1,000 hours, and inside that, unplanned requests eat 220. That is the picture a table of numbers cannot give you — the reason Sankey survives as a project tool is that the proportional widths make the awkward slab visible before it becomes a status report.

    What it does not do

    No animation, no drag-to-reorder nodes, no cloud storage, and no accounts. The layout is deterministic: the same input with the same width and height always produces the same diagram, which matters if you are regenerating a chart for a deck every month. If you need to nudge a node by hand, export the SVG and move it in a vector editor.

    Questions people ask

    Where does my data go?

    Nowhere. The parser, layout and drawing all run in your browser; there is no request when you type, and no analytics script on this page. The input is saved to this browser's local storage so a refresh does not lose it — nothing is transmitted.

    Can I use decimal amounts?

    Yes, and they can be as precise as you like — [209247.2712] is valid. Amounts must be greater than zero; a zero or negative flow is rejected with the line number, because a zero-width band conveys nothing.

    What happens when a node's inputs and outputs disagree?

    The node is drawn at the larger of the two totals and the surplus is visible as a gap. That is usually a data mistake worth seeing rather than something to hide — a source that sends 100 but receives 60 is telling you something.

    Can I paste in a list I already have?

    If your data is already shaped as Source [amount] Target, yes — one flow per line, nothing to configure first. Coming out of a spreadsheet, add a column of =A2 & " [" & C2 & "] " & B2 and copy that column in. The syntax table above is the whole language; there is nothing else to learn.

    Do the color mean anything?

    By default each node takes the next color in a ten-color palette in the order it first appears, and flows inherit their source node's color at 45% opacity. Declaring a node color overrides both, and a per-flow color overrides that.

    Can I get the numbers back out?

    Every band carries its value in its title, so hovering shows Source → Target: value, and the SVG export keeps those titles. The labels print each node's total in the unit prefix and suffix you set.

    Both downloads have a transparent background — the SVG has no background element at all and the PNG keeps its alpha channel — so a diagram pasted onto a colored slide or a document page sits on it cleanly instead of carrying a white rectangle. The preview's own setting is only about how it looks here.

    Related tools

    Last updated · Built and tested by Sam Winters. The arithmetic and the diagram are both generated in the browser, so this page works offline once loaded.