Home › Finance › ROI Calculator
ROI Calculator
Computes the net gain and percentage return on investment from the amount invested and its final value, and the annualized (compound) return when the holding period in years is given.
When to use
You want the total percentage return of an investment, project or marketing spend, optionally converted to a per-year rate for comparison across holding periods.
Do not use when: There were multiple cash flows at different dates (that needs IRR/NPV), or you only need the growth rate between two values (use cagr).
Formula
ROI = (final_value − initial_investment) / initial_investment × 100; annualized ROI = ((final_value / initial_investment)^(1 / years) − 1) × 100
Simple holding-period return. The annualized figure is the equivalent constant compound rate (same as CAGR) and is only meaningful for periods of a year or more.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
initial_investment | number | yes | Total cost of the investment including fees. Range: > 0, ≤ 1000000000000 | |
final_value | number | yes | Value at the end (sale proceeds plus any income received). Range: ≥ 0, ≤ 1000000000000 | |
years | number | years | no | Optional length of the investment in years; enables the annualized return. Range: > 0, ≤ 200 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
net_gain | number | final_value − initial_investment (negative for a loss). | |
roi_percent | number | % | net_gain / initial_investment × 100. |
return_multiple | number | final_value / initial_investment (2 = money doubled). | |
annualized_roi_percent | number | % | ((final_value / initial_investment)^(1/years) − 1) × 100; only when years is given. |
Example
10,000 grows to 15,000 in 3 years: {"initial_investment":10000,"final_value":15000,"years":3} → {"net_gain":5000,"roi_percent":50,"return_multiple":1.5,"annualized_roi_percent":14.47}
2,000 falls to 1,500: {"initial_investment":2000,"final_value":1500} → {"net_gain":-500,"roi_percent":-25,"return_multiple":0.75}
GET https://tttkmbb.com/api/v1/calculate/roi?initial_investment=10000&final_value=15000&years=3
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/roi(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/roi · Markdown: https://tttkmbb.com/finance/roi.md · JSON definition: https://tttkmbb.com/finance/roi.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="roi" - OpenAPI operationId:
calculate_roi - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Investopedia – Return on Investment (ROI): How to Calculate It (reference)
- Wikipedia – Return on investment (reference)
FAQ
Why is the annualized ROI less than ROI divided by years?
Because returns compound: 50 % over 3 years equals 14.47 % per year compounded, not 16.67 %, since 1.1447³ = 1.5.
Should dividends or rent be included?
Yes, add all income received to final_value and all costs (fees, taxes, repairs) to initial_investment to get a total return.
Related calculators
- CAGR Calculator — Compound annual growth rate between two values.
- Percentage Change Calculator — Plain percentage change between two numbers.