Sankey Diagram Builder

// FLOWS • BALANCE • ANNOTATE • EXPORT

A drawing of the numbers you typed, with an arithmetic check. Not a verified balance of mass, energy or money. Ribbon widths are your amounts on one scale, and the balance compares what you entered going into each node with what you entered coming out. It cannot tell a measurement error from a stream you left off, and a diagram that closes is not evidence that the numbers are right. Used at your own risk. Open for the full scope limits.

What this tool actually does

It parses a list of flows, adds them up at each node, and draws the result. Nothing on the page knows what is flowing, what the nodes are, or where your numbers came from.

  • The balance is addition and one comparison. A node balances when its inflow and outflow agree within the tolerance you set, as a share of the larger of the two. Loosen the tolerance far enough and anything balances.
  • Inputs and outputs are inferred from the list. A node with nothing entering it is treated as a system input and a node with nothing leaving it as a system output. A stream you forgot to enter turns an internal node into a boundary and can make a wrong balance close.
  • Amounts with separators are coerced. A single comma is read as a decimal point, so 1,5 is 1.5 and 1,234 is 1.234, not 1234. Each one is listed under "Check these". If the reading is wrong, the diagram is wrong by that factor and looks no different.
  • A recycle is chosen by typing order. The flow whose line closes a loop is the one drawn as the return. That is a drawing decision. It changes no number.

Not checked, at all

  • Units. Every amount is taken to be in the same unit on the same basis. Mixing kg/h with t/d, or mass with moles, volume or energy, produces a diagram that draws cleanly and means nothing.
  • Volumes and moles are not conserved. A volumetric balance across a temperature, pressure or phase change does not close, and a molar balance across a reaction does not close, however good the measurements are.
  • Components. A total balance can close while a component balance is badly wrong. Water in equals water out is a different check from mass in equals mass out.
  • Accumulation. The check assumes steady state. A tank filling, a bed loading or a batch in progress shows up as missing outflow.
  • Measurement uncertainty. No error bars, no data reconciliation, no weighting by meter quality. A gap smaller than your instruments can resolve is reported the same way as a real loss.
  • Energy terms. For an energy diagram, nothing here knows about heat of reaction, reference states, shaft work or ambient loss unless you enter each one as a flow.
  • Whether the boundary is right. The tool balances the system you drew, not the one that exists.

A diagram that closes tells you the numbers you entered are consistent with each other. It does not tell you that any of them is correct, and two wrong numbers can close a balance as neatly as two right ones.

What the picture can mislead about

  • Thin flows. A flow under one pixel wide is drawn as a dashed line and is not to scale. Small does not mean unimportant: a trace stream can be the one that matters.
  • Colour. The palette has eight colours and repeats after that. Two nodes sharing a colour are not related. Read the labels.
  • Position and length. Only ribbon width carries a quantity. Ribbon length, node order, crossings and the height of a column mean nothing, and a node you have dragged can make a ribbon run backwards.
  • Exports. A PNG carries the page font for Latin text only; other scripts fall back to your system font, and an SVG uses whatever fonts the program opening it has, so labels can sit slightly differently from the screen. Check an export before it goes into a report.

Never use this for

  • Custody transfer, fiscal metering, allocation, invoicing, or any balance that money changes hands on.
  • Emissions, discharge, waste or greenhouse-gas reporting to a regulator, a permit, or an auditor.
  • Material accountancy for controlled, hazardous, radioactive or safeguarded substances.
  • Relief, flare, vent or containment loads, or any process-safety figure taken from a balance.
  • Equipment sizing or a design basis without an independent balance behind it.
  • Financial statements, audits, tax, or any figure a third party will rely on.

Projects are stored in this browser only

Up to ten projects are kept in this browser's local storage, on this device, and are never sent anywhere. Clearing site data, using a private window, or switching browser or device loses them. It is a convenience, not a backup: use Export file to keep a copy of anything that matters.

Before you rely on a diagram

Trace every amount back to its source. Confirm that all of them share one unit and one basis. Rebuild the balance independently, in a spreadsheet or a process simulator, and have someone qualified in the process review it before the diagram supports a decision, a report or a design.

Flows

One flow per line. Widths are drawn to a single scale.

Project

Edits are kept automatically in this browser. Save marks the point that Revert returns to.

A project file is the only copy that survives clearing this browser's data. Importing adds a project and replaces nothing.

Syntax
Feed [100] Reactor
A flow of 100 from Feed to Reactor.
Feed,Reactor,100
The same flow as CSV. Tab-separated works too, so a spreadsheet range pastes straight in.
Reactor [20] Mixer
If Mixer already feeds Reactor, this line closes a loop and is drawn as a recycle under the diagram.
@ Reactor: runs at 80 C
A note printed under that node's label.
: Reactor #4a3aa7
A colour for that node.
~ Reactor: 40, 25
A fixed place for that node, as percent across and percent down. Dragging a node writes this line for you.
> Reactor: 3
The column for that node, counted from 1 at the left. A node cannot sit left of something that feeds it, so it and everything after it move right if they must.
// comment
Ignored, as is a line starting with #.

A node with nothing entering it is a system input, and a node with nothing leaving it is a system output. An amount written as 1,5 or 1,234.5 is read as a number and listed under "Check these" with the reading used. One comma on its own is always a decimal point, so 1,234 is 1.234.

A node balances when its inflow and outflow agree within this share of the larger of the two. The default is 0.5%. A balance that passes only because of the tolerance is flagged.

To scale is the only setting where a width is an amount. Compressed narrows the gap between 1 and 10,000, and Equal removes it, so the diagram shows what connects to what. Thinnest flow widens anything smaller to that many pixels; at 0 a flow under a pixel is a dashed line. Anything not to scale is said so on the diagram. The balance is never affected.

Annotations
Advanced options

Layout

Colour

The palette has eight colours and repeats after that, so a node is always identified by its label and never by colour alone.

Export

SVG is vector and has no resolution. A PNG carries the page font for Latin text; anything else is drawn in your system font.

Diagram

Drag the bar under the diagram to make it taller or shorter; width is under Advanced. Drag a node to move it, or focus it and use the arrow keys (Shift for bigger steps, Delete to release it). A moved node is written into the flow list as a ~ line.

This draws the numbers you give it and checks only that they add up. It cannot tell a measurement error from a stream you left off, it does not check that your amounts share a unit, and a diagram that closes is not evidence that the numbers are right. Used at your own risk. See the full disclaimer at the top of the page.

Balance

Node Status In Out Difference

Flows

The diagram as a table, one row per ribbon.

From To Amount Share