Cash flow diagram generator
Sketch an engineering-economics cash flow diagram as text: one entry per period, outflows negative, inflows positive, from first cost to salvage value. It renders on your device and exports as SVG or PNG.
One step per line. Indent two spaces to branch beneath the line above.
The engineering-economics starting picture
In engineering economy, every time-value-of-money problem starts with a cash flow diagram: a time axis marked 0 to n, an arrow up for each inflow (receipts, savings, salvage) and an arrow down for each outflow (first cost, operating expenses, payments). Getting this picture right — how much, in which period, which direction — is most of the work; the factor math afterwards is mechanical.
Mermaid cannot draw arrows perpendicular to an axis, so this page encodes direction in the sign instead: one node per period carrying its net cash flow, minus for out, plus for in. Time runs down the page in the default template, or left to right if you prefer the axis shape — both render exactly and export cleanly.
Conventions that keep the diagram honest
Use the end-of-period convention: unless stated otherwise, a period’s flows are assumed to occur at its end, and t = 0 is now — usually where the first cost sits. When one period has several flows, either net them into a single signed number or list each in the label, as the rental example does with rent and a roof replacement in the same year.
Perspective decides every sign. A $20,000 loan is +20,000 followed by five payments of −4,748 to the borrower, and the exact mirror image to the lender. If a diagram feels wrong, check whose pocket you are drawing.
From diagram to P, A and F
The diagram exposes the standard patterns: a single present amount P at t = 0, a uniform series A repeating every period, and a future amount F such as a salvage value. The default example is the classic P-plus-A-plus-F shape — −50,000 now, +14,000 a year for five years, +8,000 salvage at the end — so choosing factors like P = A(P/A, i, n) + F(P/F, i, n) becomes straightforward.
Because the diagram is text, sensitivity checks are quick: change a period’s amount or add a year, re-render, and export a fresh SVG or PNG for the homework, report or memo.
Diagram types
Frequently asked questions
What is a cash flow diagram?
It is the standard engineering-economics picture of a project’s money over time: a time axis from 0 to n with a cash flow at each period — money in and money out. It is the first step of any present-worth, annual-worth or rate-of-return analysis.
How does this tool show inflows and outflows without vertical arrows?
By sign convention: each period node carries its net cash flow, written +$ for inflows and -$ for outflows. That is the same information the textbook’s up and down arrows encode — and the signed numbers are what you type into the formulas anyway.
What is the end-of-period convention?
The assumption that all cash flows in a period occur at its end. It is the default behind engineering-economy factor tables and calculators, so a diagram drawn with it plugs straight into the formulas. t = 0 is the present, where a first cost usually sits.
How do I draw a loan from the lender’s side?
Mirror every sign of the borrower’s diagram: the principal becomes an outflow (−P at t = 0) and the payments become inflows (+A each period). The loan example above shows the borrower’s view.
Is this a personal budgeting tool?
No — it draws the dated cash-flow pictures used in engineering economics and finance coursework. You can sketch any dated inflows and outflows with it, but it does not track accounts or categories.
Is my financial data uploaded?
No. The diagram renders entirely in your browser, so amounts, project names and assumptions stay on your device.