C = I + F · P = V + D · ROI = (P − C) ÷ C × 100
I is initial investment, F is additional costs, V is ending value, D is income received, C is total cost, and P is total proceeds. Net profit or loss equals P − C. A strictly positive initial investment keeps the denominator positive. Blank costs and income are treated as zero; the initial investment and ending value are required.
This is a simple holding-period calculation for the totals entered. It does not annualize the return, weight cash flows by date, calculate IRR, model borrowing or short positions, adjust for inflation, or convert currencies. It makes no automatic tax calculation. Costs and income affect the result only when entered, and the same amount must not be included twice. With nonnegative proceeds, the lowest possible ROI in this model is −100%; gains have no separate percentage cap.
Each input accepts up to 64 characters, 15 digits before the decimal point, and 10 decimal places. Expressions and scientific notation are not accepted. All arithmetic uses exact integer fractions with no intermediate rounding. Results can have more integer digits than the inputs.
The final display uses your selected maximum decimal places, removes trailing zeros, and rounds halfway values away from zero. The ≈ symbol marks a value changed by display rounding. A notice appears when a nonzero gain, loss, or amount rounds to zero. The gain/loss classification uses the unrounded result. Changing display precision does not add a history entry or apply a bank's currency rounding policy.
Reference: FINRA — Calculating Your Investment Returns explains ROI using investment cost, fees, value changes, and income, and distinguishes total returns from annualized returns. This calculator is a mathematical aid, not a forecast or a recommendation to buy or sell an investment.